Last active
November 20, 2024 12:25
-
-
Save ilmax/f3d6af37d73b0ca070a40d2f0206eb9d to your computer and use it in GitHub Desktop.
Git aliases
This file contains hidden or 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
git config --global alias.unstage 'reset HEAD --' | |
git config --global alias.co checkout | |
git config --global alias.br branch | |
git config --global alias.mem '!git fetch origin main; git merge origin/main' | |
git config --global alias.rem '!git fetch origin main; git rebase origin/main' | |
git config --global alias.ci commit | |
git config --global alias.st status | |
git config --global alias.purge '!git fetch -p && git branch -vv | awk '"'"'/: gone]/{print $1}'"'"' | xargs git branch -d' | |
git config --global alias.cleanup '!git branch --merged | grep -v '"'"'\*\|master\|develop|main'"'"' | xargs -n 1 -r git branch -d' | |
git config --global alias.lc 'log -1 HEAD' | |
git config --global alias.cp cherry-pick | |
git config --global alias.wip '!git add --all; git ci -m WIP' | |
git config --global alias.unwip '!git reset --soft HEAD~1; git unstage' | |
git config --global alias.bh 'for-each-ref --sort=-committerdate refs/heads/ --format="%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))"' | |
git config --global alias.rh '!git reset --hard' | |
git config --global help.autocorrect 20 | |
git config --global alias.new '!f() { git checkout main && git pull && git checkout -b $1;}; f' | |
git config --global alias.ri '!git rebase -i' | |
git config --global alias.col 'checkout @{-1}' | |
git config --global push.default current | |
git config --global push.autoSetupRemote true | |
git config --global branch.main.pushRemote no_push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment