Last active
November 22, 2021 09:41
-
-
Save n1kk/869c293646868aaa22fedad46e2e13d9 to your computer and use it in GitHub Desktop.
my git aliases
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
# list all aliases | |
git config --global alias.ls-alias 'config --get-regexp alias' | |
# load ssh agent for this session to not enter key password every time | |
# actually they don't work via git aliases, you have to put it in your .bashrc | |
git config --global alias.ssh-agent \!"eval \`ssh-agent\`; ssh-add" | |
git config --global alias.sa ssh-agent | |
# puch local only branch to origin and create there remote branch with same name | |
git config --global alias.publish push -u origin HEAD | |
# clear staged files | |
git config --global alias.unstage 'reset HEAD --' | |
# clear all local branches leaving only master | |
git config --global alias.purge-branches '!git branch | grep -ve " master$" | xargs git branch -D' | |
# checkout master and get latest | |
git config --global alias.master '!git checkout master && git pull origin' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment