diff --git a/git-sync.sh b/git-sync.sh index a352c6d..b87ab8e 100755 --- a/git-sync.sh +++ b/git-sync.sh @@ -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