Git merge "Already up to date" but not

Viewed 9713

I messed up a bit. I am working on a project, It has many different branches. I merged branch A to master, there was some conflict. I messed up here, I did not look into the conflict properly and removed the arrows and then commit then push into master. But It the current master branch does not have the changes I have made on the Branch A. I tried again to merge branch A into master again, but it says "Already upto date".

How do I merge into master again ?

3 Answers

When you merge two branches using the command git checkout master and git merge develop, this will make master and develop share the commit trace.

I finally found that solution by checking the documentation at https://git-scm.com/docs/git-merge and I discover that the two branches are merged using the fast forward option, so if you want to keep both branches separated and merge as a commit with the name "Merge develop into master", I suggest to use this command:

git checkout master
git merge --commit --no-ff develop

You can add the option --no-edit, so git will not ask you a message content in the merge commit.

Related