Created
September 15, 2016 20:00
-
-
Save werkshy/4d3b986eab0a9fb1caa501ad626e15e4 to your computer and use it in GitHub Desktop.
Git aliases for ~/.gitconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
s = status | |
st = status # svn muscle memory | |
stat = status # svn muscle memory | |
co = checkout # svn muscle memory | |
cp = cherry-pick # svn muscle memory | |
fp = push --force-with-lease # prevents force push if there's new commits on master | |
lol = log --pretty=oneline --abbrev-commit --graph --decorate # compact log format | |
recent-branches = !"git for-each-ref --sort=-committerdate refs/heads/ | head" # show recent branches | |
list-merged = !"git branch --merged | grep -v '\\*' | grep -v master | xargs -n 1" # list branches that are merged into master | |
delete-merged = !"git branch --merged | grep -v '\\*' | grep -v master | xargs -n 1 git branch -d" # delete branches that are merged into master | |
unpushed = log --branches --not --remotes=origin # show branches that have not been pushed to master | |
wip = !"git add -A; git commit -n -m 'wip'" # create a quick WIP commit of your current state | |
unwip = !git log -n 1 | grep -q -c wip && git reset HEAD~1 # reset the last commit if it is a WIP commit (go back to your pre-wip state) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment