Created
April 13, 2022 14:10
-
-
Save ryangreenberg/df72c4d95f3a10fd2c27bfde18a2dec3 to your computer and use it in GitHub Desktop.
Git aliases that support master or main
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
# main or master? | |
alias morm='(git rev-parse --quiet --verify origin/main && echo "main") || echo "master"' | |
alias gmom='git merge origin/$(morm)' | |
alias gdom='git diff origin/$(morm)' | |
alias grom='git rebase --autosquash origin/$(morm)' | |
alias gromi='git rebase --autosquash -i origin/$(morm)' | |
alias gfom='git fetch origin $(morm)' | |
alias gpom='git pull origin $(morm)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment