You can use the following command to see a summary of the differences between your current branch and stage/master
:
$ git diff --name-status ..stage/master
M practice.txt
A shazbot.txt
D foobar.txt
where M
stands for "Modified", A
stands for "Added", and D
stands for "Deleted".
If you want to see in which commits these files were modified, added, or deleted, you can use the log
command instead, with the same --name-status
argument:
$ git log --oneline --name-status ..stage/master
31b9628 Add shazbot.txt
A shazbot.txt
e56da37 Merge branch 'develop'
790f3bf Revert "Revert "Merge branch 'develop'""
M practice.txt
d9493e0 Merge branch 'master' into develop
8832960 Revert "Merge branch 'develop'"
M practice.txt
2b82909 Merge branch 'develop'
2d41fb6 Fix bug 01
M practice.txt
526bf16 Add feature 02
M practice.txt
ba8700c Add feature 01
M practice.txt
bb8ced2 Add practice.txt
A practice.txt
Asking about which commits introduce changes is more reliable in Git than asking about which branches, because in Git, branches are just cheap labels that can be applied and removed from commits, and may no longer exist in any of the repos/remotes that you're using.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…