How can I view new files that would be introduced on merging branches?
Imagine a branch named A. We fork a branch named B from it, and we commit stuff around. Some of the commits are modifiying existing files, while some of them will be introducing new files.
If I switch back from B to A, is there a way to find out what new files B will introduce when I merge them?
3 Solutions collect form web for “How can I view new files that would be introduced on merging branches?”
You can run
git merge --no-commit --no-ff B, then see the changes and then rollback, or you can try
git diff between last commits in A and B branches and examine this diff on order to see new files. If your branch B is branched from HEAD of branch A, there should not be any conflicts in
git diff would run fine.
--stat option for
git diff will give you a list:
git diff --stat A..B
--diff-filter=[(A|C|D|M|R|T|U|X|B)…[*]] option of
git diff to filter out the
A added files, or whichever is the important one for you.