DEV Community

Discussion on: Easily auto-squash changes to previous commit

Collapse
 
r3dey3 profile image
Kenny K

git commit also has a --no-edit flag that is very useful for --ammend. I have 3 aliases for --ammend in my .gitconfig:

    ca = commit --amend
    can = commit --amend --no-edit
    cana = commit --amend -a --no-edit
Enter fullscreen mode Exit fullscreen mode
Collapse
 
samipietikainen profile image
Sami Pietikäinen

I hadn't noticed the no-edit flag. So basically in this case it would be like --amend -C HEAD. I like to use rebase alot, but indeed in this case amend would be simpler.