Skip to content

Commit

Permalink
Support both master and main for git commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishb committed Jul 8, 2023
1 parent 108d053 commit 04464a7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions _gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@
cip = !git commit --amend && git push -f
br = branch
co = checkout
# Checks out the default branch - master or main
com = !git checkout $(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
df = diff --color-words --word-diff-regex=.
lg = log -p
hist = log -20 --pretty=format:"%C(yellow)%h%Creset\\%C(green)%ar%C(cyan)%d\\ %Creset%s%C(yellow)\\ [%cn]" --graph --decorate --all
spp = !git stash && git pull origin master && git stash pop
pom = pull origin master
# Pull the default branch - master or main
pom = !git pull origin $(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
spp = !git stash && git pom && git stash pop
recentbranches = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
[color]
ui = auto
Expand Down

0 comments on commit 04464a7

Please sign in to comment.