Here are now of my best git alias buddies:
amend=commit --amend --edit
append=commit --amend --no-edit
- amend: add changes to last commit
- append: same as amend without having a need to make change in the commit message
Here, I'm assuming the last commit is a local commit.
let's say you need to send modification on two files, but you forgot one file.
So now last commit file A, and you need to add the change from file B
git append path/fileb to add them to last commit.
git amend, the editor will be reopened.
Let's now say, you added the changes and committed them, but you forgot a file that is not followed by git.
Simply add it with
git add path/fileb then run
git append (or amend if you want to add things to commit message)
If you want to add these aliases, run this:
git config --global alias.amend "commit --amend --edit"
➜ git config --global alias.append "commit --amend --no-edit"