Skip to content

Commit

Permalink
Merge pull request #2176 from royatt/improve-git-aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
seefood authored Nov 6, 2024
2 parents 0375b77 + d9c339c commit a80d898
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions aliases/available/git.aliases.bash
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ alias gpatch='git format-patch -1'
# push
alias gp='git push'
alias gpd='git push --delete'
alias gpf='git push --force'
alias gpf='git push --force-with-lease'
alias gpff='git push --force'
alias gpo='git push origin HEAD'
alias gpom='git push origin $(get_default_branch)'
alias gpu='git push --set-upstream'
Expand Down Expand Up @@ -211,9 +212,6 @@ function gdv() {
}

function get_default_branch() {
if git branch | grep -q '^. main\s*$'; then
echo main
else
echo master
fi
branch=$(git symbolic-ref refs/remotes/origin/HEAD)
${branch#refs/remotes/origin/}
}

0 comments on commit a80d898

Please sign in to comment.