Skip to content

Instantly share code, notes, and snippets.

@SunnyRaj
Last active February 6, 2017 12:16
Show Gist options
  • Save SunnyRaj/d12a2c8626f686b8f4949a075bab99e5 to your computer and use it in GitHub Desktop.
Save SunnyRaj/d12a2c8626f686b8f4949a075bab99e5 to your computer and use it in GitHub Desktop.
Git track remote and merge
# This will track all remote branches
for remote in `git branch -r | grep -v /HEAD`; do git checkout --track $remote ; done
git checkout <your_branch>
git merge <branch_you_want_to_merge_into_yours>
# If you want to automatically select their version on conflict
# git merge --strategy-option theirs <branch_you_want_to_merge_into_yours>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment