-1

I have 2 branches merged into one another. On the other hand in one branch there are "extra" files shown. So branch A has 2 files, branch B has 3 files. If I do a pull, all I get is "Already up-to-date", which would mean the branches are the same. They are not though. How can I see the files that are present in one branch, but not in the other? Git diff <local branch> <remote branch> is not ideal as it shows me all the code. I would only need the filenames, so I can delete that extra file. Obviously there are more than one file, and I need to find how many.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Soni
  • 19
  • 1
  • 10

2 Answers2

2
git diff --name-only master <your_branch>

will list changed files on compared to master branch.

Maroun
  • 94,125
  • 30
  • 188
  • 241
  • Thanks guys, git diff --name-only master seems to do the job well. I meanwhile found a way to do the same with Beyond Compare, as I had it on my pc. git difftool --dir-diff does the job too. Thank you! – Soni May 20 '15 at 08:08
-1

You can use the git log or git diff (ill explain in details):

git log

git log ^branch_a branch_b 
git log branch_a ^branch_b

This will simulate pull/push

git diff

git diff branch_a..branch_b
git diff branch_a...branch_b
Community
  • 1
  • 1
CodeWizard
  • 128,036
  • 21
  • 144
  • 167