Guest User

Untitled

a guest
Jul 17th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. ref:
  2.  
  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:
  4.  
  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
  9.  
  10.  
  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:
  12.  
  13. git merge --strategy=ours --no-commit master
  14. git commit # add information to the template merge message
Add Comment
Please, Sign In to add comment