Created
March 12, 2012 15:26
-
-
Save garryyao/2022634 to your computer and use it in GitHub Desktop.
Git commands for rebase diverged remote branche without a merge.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BRANCH=$1 | |
git checkout $BRANCH | |
git fetch origin | |
git merge-base $BRANCH origin/$BRANCH | xargs git reset --hard | |
git merge origin/$BRANCH --ff-only |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment