79286235

Date: 2024-12-16 22:39:55
Score: 0.5
Natty:
Report link

I believe that this is equivalent to what you are looking for:

git checkout better_branch          # This is the branch whose commits you want to keep
git merge --strategy=ours master    # keep the content of this branch, but record a merge
git checkout master                 # You want to **lose** all changes on this branch
git merge better_branch             # fast-forward master up to the merge

See: https://stackoverflow.com/a/2763118/1290781

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Probably link only (1):
  • Has code block (-0.5):
  • High reputation (-1):
Posted by: John Henry