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.
Asked
Active
Viewed 2,493 times
-1

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

Soni
- 19
- 1
- 10
2 Answers
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 – Soni May 20 '15 at 08:08does the job too. Thank you!
-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