rococo
rococo

Reputation: 2657

Commit merge conflict fixes to the branch with changes

I have a master and a branch A.

I'm trying to get changes to go from A to master.

However, there are merge conflicts.

Currently, when I use git merge or similar things (for example, IntelliJ's built-in merge conflict resolver or SourceTree + KDiff3), when there are conflicts, I can fix them.

However, the fixes I make are done on the master branch.

This means with a protected remote master (i.e. via GitHub) where you can't push directly to master, I can't actually commit the merge conflict fixes.

Is there a way to make edits committed to A and then merge them altogether into master?

I can get this behavior using GitHub's merge conflict editor - when you use it, it commits the changes into branch A and then you still have to do code review, etc. to commit into master. But I would like to be able to do the merge conflict resolution in my IDE, ideally.

Edit: further searching has suggested that I can actually merge master into A, resolving conflicts in the process, and then merge A back into master. Can anyone confirm if that sounds right?

Upvotes: 0

Views: 47

Answers (1)

rootkonda
rootkonda

Reputation: 1743

If your fixes are made on master branch then your current HEAD is master. I guess you have to checkout to branch A first and then make the conflict changes and then do a merge to master.

Upvotes: 1

Related Questions