Skip to content

Instantly share code, notes, and snippets.

@yblee85
Created April 27, 2016 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yblee85/c9eaac2e360e4541e6c5cc7ac2e0e524 to your computer and use it in GitHub Desktop.
Save yblee85/c9eaac2e360e4541e6c5cc7ac2e0e524 to your computer and use it in GitHub Desktop.
Git (replace master with a branch)
// sometimes accidently you switched to a branch and working on it
// and forgot to merge with master for a long long time
// now it would be really difficult to merge with master
// this will basically replace master with a branch
// say, you have a master and a branch named "branch1"
git checkout branch1
git merge -s ours master
git checkout master
git merge branch1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment