我使用多个存储库(比如repo-1、repo-2、repo-3),所有的存储库都有共同的分支名称(分支-1、分支-2、分支-3)。有没有办法在‘commit-A’(在repo-1上,分支-1)和'commit-E‘(在repo-3上,分支-1)之间的所有存储库上找到提交到分支-1的历史记录。
发布于 2017-05-15 07:01:28
你可以在任何git repo中做到这一点。但是,为了保持所有内容的整洁和清晰,让我们在临时回购中进行。
git init temp
cd temp
#If you have already known exactly the sha1 values of commit_A and commit_E,
#":repo1" and ":repo3" in the following two commands can be omitted.
git fetch <repo1_url> branch_1:repo1
git fetch <repo3_url> branch_1:repo3
#If you haven't, find them out first.
#History between commit-A and commit-E is ambiguous.
#It may have three different meanings:
#1.History of commits that are reachable from commit_A but not reachable from commit_E
git log commit_E..commit_A
#2.History of commits that are reachable from commit_E but not reachable from commit_A
git log commit_A..commit_E
#3.History of commits that are either reachable from commit_A or reachable from commit_E,
#but not reachable from both at the sam time.
git log commit_A...commit_E
#or
git log commit_E...commit_A
#Finally remove the temporary repo.
cd ..
rm -rf temphttps://stackoverflow.com/questions/43968070
复制相似问题