title | category | description | type |
---|---|---|---|
Git |
Git |
Git commands arround commits, stash, staging |
personal |
git commit -m "Message" -- ./dir
$ git reset --soft HEAD~1
$ git reset
Undo the last commit + unstage everything.
$ git stash; git reset --soft HEAD~1; git stash pop;
Stash changes + undo the last commit + re-add changes.
$ git commit --allow-empty -m "Trigger re-deploy"
git diff COMMIT^!
$ git diff --staged
$ git add -n
Warning: this is incompatible with stashing unstaged files somehow.
$ git stash -k -u
Stash unstaged files & untracked files (-u).
git branch -vv | cut -c 3- | awk '$3 !~/\[/ { print $1 }'