Skip to content

Commit

Permalink
Getting master/main headaches
Browse files Browse the repository at this point in the history
  • Loading branch information
jhrr committed Sep 8, 2021
1 parent 750bb6f commit 46a5066
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions git-aliases
Expand Up @@ -225,13 +225,14 @@ alias gSB='git-sync-branch'

# Usage: git-sync-fork $REMOTE $BRANCH
git-sync-fork() {
local _remote
_remote='upstream'
git-in-repo && \
git fetch --all && \
if [[ $# -eq 0 ]]; then
git pull --ff-only "${_remote}" master
local _remote
_remote='upstream'
git pull --ff-only "${_remote}" "$(git rev-parse --abbrev-ref HEAD)"
elif [[ $# -eq 1 ]]; then
git pull --ff-only "$1" master
git pull --ff-only "$1" "$(git rev-parse --abbrev-ref HEAD)"
elif [[ $# -eq 2 ]]; then
git pull --ff-only "$1" "$2"
else
Expand Down

0 comments on commit 46a5066

Please sign in to comment.