3 ms·
I have this alias in my ~/.gitconfig: cancel = reset --soft HEAD^ I don't want an alias to hard reset, it seems to dangerous and a good way to lose some w
by p4bl0 10y ago
I have this alias in my ~/.gitconfig:
cancel = reset --soft HEAD^
I don't want an alias to hard reset, it seems to dangerous and a good way to lose some work. However a soft reset like this allow me to cancel the last commit and add an omitted file, or remove one from the commit, or simply to correct the commit message easily.
- phaemon 10y agoActually, if that's all you want, you can do: git add <file> # or "git rm --cached <file>" to remove git commit --amend and it will replace with a new commit that has what you want. It's like a mini rebase -i
- p4bl0 10y agoTrue, but I prefer to be able to see my staged changes as a whole to be sure that I did everything as I wanted.
- deleted 10y ago[deleted]
- tempodox 10y agoYep, git gives you more than enough rope to hang yourself with.