2017-05-14 21 views
0

私は複数のリポジトリ(repo-1、repo-2、repo-3など)を扱い、すべてのリポジトリは共通のブランチ名(ブランチ1、ブランチ2、ブランチ3)。 「コミットA」(repo-1、ブランチ1)と「コミットE」(repo-3、ブランチ1)の間のすべてのリポジトリでブランチ1へのコミットの履歴を見つける方法はありますか?GITリポジトリ間のブランチ上のコミットの履歴を見つける

+0

レポジトリは関係していますか?彼らはフォークですか? –

+0

これは興味深い[repo](https://github.com/dreamyguy/gitlogg)ですが、役に立つかもしれません。 – Sylogista

+0

@ LasseV.Karlsenはい。リポジトリは関連しています。 –

答えて

0

これはどんなgitリポジトリでも実行できます。しかし、すべてをきれいにしておくために、一時的なレポでそれをやりましょう。

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 
関連する問題