Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
GIT查找跨回购的分支上的提交历史记录_Git_Github - Fatal编程技术网

GIT查找跨回购的分支上的提交历史记录

GIT查找跨回购的分支上的提交历史记录,git,github,Git,Github,我处理多个存储库(比如repo-1、repo-2、repo-3),所有存储库都有共同的分支名称(branch-1、branch-2、branch-3)。在“提交-a”(在repo-1上,分支-1)和“提交-E”(在repo-3上,分支-1)之间的所有存储库中,是否有一种方法可以找到提交到分支-1的历史记录。您可以在任何git repo中执行此操作。但为了保持一切清洁和清晰,让我们在临时回购中这样做 git init temp cd temp #If you have already known

我处理多个存储库(比如repo-1、repo-2、repo-3),所有存储库都有共同的分支名称(branch-1、branch-2、branch-3)。在“提交-a”(在repo-1上,分支-1)和“提交-E”(在repo-3上,分支-1)之间的所有存储库中,是否有一种方法可以找到提交到分支-1的历史记录。

您可以在任何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 temp
git init temp
cd温度
#如果您已经确切知道commit_A和commit_E的sha1值,
#以下两个命令中的“:repo1”和“:repo3”可以省略。
git获取分支_1:repo1
git获取分支_1:repo3
#如果你还没有,先找到他们。
#commit-A和commit-E之间的历史不明确。
#它可能有三种不同的含义:
#1.可从提交A访问但无法从提交E访问的提交的历史记录
git日志提交..提交
#2.可从commit_E访问但无法从commit_A访问的提交的历史记录
git日志提交A..提交E
#3.可从提交A访问或可从提交E访问的提交的历史记录,
#但在sam时无法从两者联系到。
git日志提交A…提交E
#或
git日志提交…提交
#最后,取消临时回购协议。
光盘
rm-射频温度

存储库是否相关?它们是叉子吗?这很有趣,可能有用。@LasseV.Karlsen是的。存储库是相关的。