In Git, can I view all commits from a branch merge?
I'm working on a project and I see several merge commits from another developer. For some reason, he was merging an unfinished topic branch into our master branch on a daily basis. I want to see all the commits from his topic branch, but I can't just check it out because it was never push开发者_StackOverflowed to the remote repo. So what I want to know is, can I somehow view all commits that came into the master branch during his merges?
You can't see the commit history of his personal branch, as it is not part of his merging commits.
Update: That's actually not quite right, as I've just seen in a little test. Could you go into more detail on how exactly he merged his changes into your branch without showing his own commits from his branch?
Sorry for the confusion.
From the original answer:
You could use git log
with the options --merges
and --author=<pattern>
, to filter all merges done by this specific author. You can then happily diff against those commits. This way, you could at least find all the changes he's made with his merges in one place.
If his local branch is still there you could add his repository as a remote to your and browse his history.
git remote add coworker /some/path/repo.git
git fetch coworker
git log master coworker/featureX
The last git log will show all commits that are reachable from your master and coworker/featureX.
精彩评论