Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to see merge conflict on GitHub by comparing branches?

I'm always having a hard time merging branches on GitHub. I admit I'm not that versed in Git CVS so I rather use visual tools like GitHub Desktop and GitHub Website to accomplish my goals.

The way I've defined our dev process is to have 3+N branches:

  1. master - represents production environment
  2. staging - represents staging environment
  3. development - main development branch from where we all create feature/bug/hotfix branches

So whenever one wants to develop something, they create a branch off of development and start implementing it.

When development is done, their feature branch is then merged back into development and if all goes well, development branch is then merged into staging for testing.

I understand that since we don't do any specific testing on development branch that we could easily discard it and we'd only work with master and staging branches to accomplish for the same. Staging branch is actually being tested. Mildly, but still is.

Now I have a developer that has now created two features and each time I was merging a pull request into development I had issues merging it. The problem is I don't know how to actually see the issues on the web (comparing branches for instance) to tell the guy how to do things so I can do actual work than manage our code repo. It's frustrating at least...

So whenever I create a pull request. GitHub tells me, that I have some merge conflicts that can't be automatically resolved, but how do I see these?

Actually given my visual tools, what is the best way for me to resolve issues?

like image 745
Robert Koritnik Avatar asked Aug 26 '15 09:08

Robert Koritnik


People also ask

How do you check if there are any merge conflicts?

git merge-tree will execute the merge in memory and print the result to the standard output. Grep for the pattern << or >> . Or you can print the output to a file and check that. If you find a line starting with 'changed in both' then most probably there will be a conflict.


1 Answers

I'm not sure if this helps but GitHub has recently released conflict resolution on the web interface:

github merge conflicts

If you use pull requests, this will be able to help quite a lot. If you don't (bummber) then it might be an overkill to open the pull request just to see the conflict. The good thing is that unless you have complex conflicts (renamed/moved files) this will not only show the conflict but prompt you to solve it.

Hope this helps.

like image 199
bitoiu Avatar answered Sep 28 '22 18:09

bitoiu