1

I have my main branch 'master' and two derived branches 'branch-a' and 'branch-b'. when i try to merge 'branch-a' in 'branch-b' github desktop checks: enter image description here and shows that there will be two conflicting files, these could be code files or dll or images, i don't know: enter image description here and when i click 'merge' it shows that files have been merged automatically.

i want to know which files were conflicting?

i have multiple features in my software, and i cannot test whole application to find which module is corrupted by this merge. maybe git have taken 'branch-a' code/dll/image and discarded 'branch-b' code/dll/image? i don't know. i just want the names of files which were conflicting. mostly it happens with dll/Libraries.

LeGEC
  • 46,477
  • 5
  • 57
  • 104
Usman
  • 43
  • 5
  • 1
    What is this GUI tool that fails to show this info? Don’t use it any longer, it’s clearly no good. And are you sure the conflict was resolved? I bet it wasn’t. Use the command line and ask for git status. – matt Oct 25 '20 at 13:31
  • its 'github desktop' : https://desktop.github.com/ – Usman Oct 25 '20 at 13:37
  • 2
    Well, throw it away. Learn to use the command line. Or use a better GUI. – matt Oct 25 '20 at 13:39

2 Answers2

1

Quickest way is to search for conflict markers in your files : "<<<<" or ">>>>"

If you find none : git probably chose a way to combine these would've conflicts.


Suppose your commits are named as below :

* mmmm (HEAD -> branch-b) Merged branch 'branch-a' into branch-b
|\
| * aaaa (branch-a) commit on branch-a
* | bbbb commit on branch-b
...

You can view :

# diff with branch-a
git diff --name-status aaaa mmmm
# rather than typing explicit commit hashes, you can also type :
git diff --name-status HEAD^2 HEAD

# diff with branch-b
git diff --name-status bbbb mmmm
# same as :
git diff --name-status HEAD^1 HEAD

If a file name appears in the diff with branch-a, and not in the diff with branch-b :
this means that the merge resulted in keeping the version from branch-b.

Conversely : if a name appears in the diff with branch-b but not in the diff with branch-a :
the merge kept the version from branch-a.

If a name appears in both lists :
this means that git combined both contents to create the merge.


You can reduce the scope of files to list to a directory or a specific file :

git diff --name-status HEAD^1 HEAD -- code/dll/
git diff --name-status HEAD^1 HEAD -- code/dll/image
LeGEC
  • 46,477
  • 5
  • 57
  • 104
  • it seems its not a code conflict, code conflict is shown by >>>> and <<<<. supposedly its a conflict in Library/Image/Binary file. there are 1400 files being merged, i cannot check each file. – Usman Oct 26 '20 at 07:20
1

You can just go ahead and hit "Merge branch-a into branch-b" that the very next thing GitHub Desktop will do is to show you the conflicting files and allow you to resolve the conflicts before actually committing the merge. You will also have the option to abort the merge, as shown on the image below:

enter image description here

Joao Leme
  • 9,598
  • 3
  • 33
  • 47