make current branch master 1

make current branch master

git checkout better_branch
git merge --strategy=ours master    # keep the content of this branch, but record a merge
git checkout master
git merge better_branch             # fast-forward master up to the merge

Here is what the above code is Doing:
1. Checkout the branch you want to merge into (in this case, master)
2. Merge the other branch into the checked out branch (in this case, master) using the –strategy=ours option. This keeps the content of the checked out branch (master) and ignores the content from the other branch (better_branch).
3. Checkout the other branch (better_branch)
4. Merge the checked out branch (master) into the other branch (better_branch)

Similar Posts