a guest Jul 17th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ref:
  3. The problem with the other two answers is that the new master doesn't have the old master as an ancestor, so when you push it, everyone else will get messed up. This is what you want to do:
  5.   git checkout better_branch
  6.   git merge --strategy=ours master    # keep the content of this branch, but record a merge
  7.   git checkout master
  8.   git merge better_branch             # fast-forward master up to the merge
  11. If you want your history to be a little clearer, I'd recommend adding some information to the merge commit message to make it clear what you've done. Change the second line to:
  13.   git merge --strategy=ours --no-commit master
  14.   git commit          # add information to the template merge message
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand