3 ms·
git add […] && EDITOR=true git commit --amend && git push -f […] (You don't have to open a PR / the usual history rewriting consequences don't apply if you're
by deathanatos 4y ago
git add […] && EDITOR=true git commit --amend && git push -f […]
(You don't have to open a PR / the usual history rewriting consequences don't apply if you're just pushing to Actions to see how it reacts.)
But alternatively, if you find yourself doing this a lot and it's really the code of the step that you're debugging (vs. debugging how the workflow interacts with Actions itself) I try to keep my jobs' steps pretty simple:
- run: ci/thing.sh
… specifically so that I can run the step locally. It's usually much faster. (And on a MBP, doesn't incur the costs of virtualization, at the cost of needing to port to macOS. Usually worth it.)
- gilnaa 4y agoEDITOR=true is clever! Git has --no-edit as well, btw
- masklinn 4y agoAnd usefully it also has `-e` (`--edit`), so you can create an alias of amend = commit —-amend —-no-edit and if you need to edit the commit message alongside merging new changes in HEAD, > git amend -e
- xorcist 4y agoTo avoid editing the commit message you can use: -C <commit>, --reuse-message=<commit> Take an existing commit object, and reuse the log message and the authorship information (including the timestamp) when creating the commit. In the above example, commit can simply be "HEAD", when doing the amend commit: git commit -C HEAD --amend