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,488 times
-1
Brian Tompsett - 汤莱恩
- 5,438
- 68
- 55
- 126
Soni
- 19
- 1
- 9
2 Answers
2
git diff --name-only master <your_branch>
will list changed files on compared to master branch.
Maroun
- 91,013
- 29
- 181
- 233
-
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
- 110,388
- 20
- 126
- 153