My ideal workflow would consist of the following steps
- edit the code
- compile
- git commit -a -m “commit message”
- start running the new binaries, tests, etc. (may take 10+ minutes)
- start new changes, while the binaries are still running
- when step # 4 is finished, edit the commit message from step # 3, without committing the changes introduced in step # 5, by adding, say, “test FOO failed”
I cannot use git commit -a --amend -m "new commit message", because this commits the new changes as well. I’m not sure that I want to bother with staging or branching. I wish I could just edit the commit message without committing any new changes. Is it possible?
There’s no need to stash or do anything else here.
git commit --amend -m 'Your new message.'will not commit any new changes (note the lack of
-aflag), provided that you haven’t explicitly added them to the index (usinggit add, for example).