Last active
May 16, 2021 09:48
-
-
Save trajano/30ecee958a11f3d296612018272c456d to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
git config --global alias.pu '!git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)' | |
git config --global alias.puf '!git push --force --set-upstream origin $(git rev-parse --abbrev-ref HEAD)' | |
git config --global alias.r '!git fp && (GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash origin/HEAD || GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash origin/master)' | |
git config --global alias.fr '!git fp && git pull --rebase origin HEAD' | |
git config --global alias.fp 'fetch --prune' | |
git config --global alias.ac '!git add -A && git commit' | |
git config --global alias.amend 'commit --amend -a --reuse-message=HEAD' | |
git config --global alias.remaster 'rebase -i origin/HEAD' | |
git config --global alias.rh 'rehead' | |
git config --global alias.rehead '!git fetch && git checkout origin/HEAD -b' | |
#git config --global --get-regexp alias.* | sed 's/\(alias\.[^ ]\+\) \(.*\)/git config --global \1 '\"'\2'\"'/'" | |
git config --global --get-regexp alias.* | sed 's/!/\\!/g' | sed 's/\(alias\.[^ ]\+\) \(.*\)/git config --global \1 '\"'\2'\"'/' | |
git config --global alias.aliases "!git config --global --get-regexp alias.* | sed 's/\(alias\.[^ ]\+\) \(.*\)/git config --global \1 '\"'\2'\"'/'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment