Last active
September 11, 2018 11:37
-
-
Save micha149/1319346 to your computer and use it in GitHub Desktop.
Git commands
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
# Create a git alias with a colored history listing | |
git config --global alias.hist "log --all --format='[%C(cyan)%h%C(reset)] %C(red)%d%C(reset) %s %C(dim)# %an%C(reset)' --graph" | |
# call api from gitignore.io from console | |
git config --global alias.ignore "!gi() { curl -L -s https://www.gitignore.io/api/$@ ;}; gi" | |
# delete all merged branches except master, develop and the current checked out branch | |
git config --global alias.cleanup "!git branch --merged | grep -v '^\*\|master\|develop' | xargs -n1 git branch -d" | |
# Create temporary commit of staged changes and fixup it into the given commit | |
git config --global alias.fixup "!sh -c 'REV=$(git rev-parse $1) && git commit --fixup $@ && git rebase -i --autostash --autosquash $REV^' -" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment