DEV Community

Discussion on: Git hacks you should know about

Collapse
 
gergelypolonkai profile image
Gergely Polonkai • Edited

git commit --amend will add anything in the staging area (or index; the thing files get to when using git add), and let you change the commit message. If you only want to change the commit message leaving the index alone, you can use git commit --amend --only.

When you want to remove a file from the latest commit, after using git reset --soft and co. you can use git commit -C ORIG_HEAD so you don't have to enter the same commit message.

Collapse
 
iankurbiswas profile image
Ankur Biswas

πŸ‘πŸ»