简体   繁体   中英

git-svn — Why are other branches' commits mixed in with trunk commits on master?

I'm tracking a svn repository using git. A merge was done on 2014-01-09 (producing commit A ) and another on 2014-02-12 (producing commit B ). When I git checkout master; git log git checkout master; git log , I see the commits for the merges, but I also see, for instance, a commit on 2014-02-04 ( C ) made against a branch (which was merged as part of B ).

Why would a commit made against a branch show up when running git log on trunk ?

I discovered this while trying to rewind my master and branches to a particular date in time to try to execute merge B again to see what conflicts exist. I had assumed that I could git checkout master; git reset --hard B^; git merge branch; git checkout master; git reset --hard B^; git merge branch; , but that didn't work, then I saw these extra commits from branches in my trunk log and got confused.

Any help you can offer on the subject will be much appreciated!

If C is part of a branch that was merged into master to produce B , then a git log on master will include all commits that were in the branch, including C . This is expected behavior, and necessary to understand all the individual commits that are a part of master . There may be a flag to git log to hide commits that also appear in different branch, but I can't find such a mechanism.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM