I am having two branches master and develop. I wanted to track all modified files and get their names before merging master with devlop branch. I have tried all solutions in these link - How to get a list of all files that changed between two Git commits?. I am only getting the modified files, when i am in develop branch before committing. One more option can be getting modified file name after pushing to develop branch. Any solutions for this? Thanks.
Asked
Active
Viewed 81 times
-1
-
Sorry, but your is question is not understable. Please update it in order to allow us to help you. – Antonio Petricca Jun 04 '21 at 12:14
-
I think OP is asking to get a *diff* of the two branches independent on what branch they currently are. What about `git diff --name-only branch1 branch2` ? – Matt Jun 04 '21 at 12:24
2 Answers
1
you can run
git diff master --name-only
from your feature/development branch to see the modified files respect to master branch. in general, you can specify one single commit id to have difference respect where you are, or two commit id to compare these. Any strategy to specify a commit id will work, so for example you can do
git diff HEAD^^ --name-only
to see how many file you modified since two commits ago, or
git diff 0ccecd 1457aab --name-only
to see file difference between two commit you know by jhash.

Felice Pollano
- 32,832
- 9
- 75
- 115
0
You should try diff, as explained in another answer but using ...
so that you can see what went on on one branch only. If you do not use the 3 dots, you get a plain diff between both branches which could potentially list files changed on either branch, not on just one of them
git diff --name-status master...develop

eftshift0
- 26,375
- 3
- 36
- 60
-
-
hahaha Hadn't noticed.... and I was typing on the phone and probably had some salty food and my thumb is wider than usual XD. Thanks for bringing it up. – eftshift0 Jun 04 '21 at 21:30