Skip to content

Commit

Permalink
fix: support branch other than master (#9)
Browse files Browse the repository at this point in the history
Fix #7
  • Loading branch information
wei authored Apr 18, 2020
1 parent ca48412 commit 000571b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions git-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,11 @@ echo "DESTINATION=$DESTINATION_REPO:$DESTINATION_BRANCH"

git clone "$SOURCE_REPO" source --origin source && cd source
git remote add destination "$DESTINATION_REPO"

# Pull all branches references down locally so subsequent commands can see them
git fetch source '+refs/heads/*:refs/heads/*' --update-head-ok

# Print out all branches
git --no-pager branch -a -vv

git push destination "${SOURCE_BRANCH}:${DESTINATION_BRANCH}" -f

0 comments on commit 000571b

Please sign in to comment.