@VonC 的回答非常好,我什至没有考虑过基于 Repo2 的主节点添加和推送另一个分支的选项。我想添加有关为什么会发生这种情况的其他信息。
因此,经过大量挖掘,我发现了 Repo1 和 Repo2 之间的分歧点。两个 repos 的 master 分支之间当前最古老的共同祖先正好位于 tag v2.0
:
git log -1 4e4bafe
commit 4e4bafed59520908e4f1e7f0b3cb71f96f59a236
Author: nobnago <ksdfhskdjfwdewf@gmail.com>
Date: Thu Jan 3 11:36:00 2013 +0100
bump version 2.0
在那之后,这两个分支似乎不再有任何共同的历史。我在对这个问题的评论中提到,我怀疑有人在之后重写了公开推送的提交,因为 Repo2 包含 tag v2.0.1
,但是标签引用的提交不包含在 Repo2 的任何分支中,也不包含在任何其他标签中(包括最新的)。
但是,在查看主分支的日志时,我看不到任何重写提交的明确证据(创作日期与提交日期大不相同,并且作者和提交者是不同的人):
# Repo2. "datelog" is an alias that displays author/author-date
# on the left, and committer/commit-date on the right.
git datelog -3 9f38b64
* 9f38b64 Flavio Lerda Flavio Lerda Thu Jan 3 15:11:35 2013 -0800 Thu Jan 3 23:14:33 2013 +0000 Merge pull request #1 from agrueneberg/searchbox
|\
| * b397e36 Alexander Grüneberg Alexander Grüneberg Sat Nov 17 21:16:03 2012 -0600 Thu Jan 3 16:27:47 2013 -0600 Search on Enter key.
* | 4e4bafe nobnago nobnago Thu Jan 3 11:36:00 2013 +0100 Thu Jan 3 11:36:00 2013 +0100 bump version 2.0
# Repo1
git datelog -2 badbf87
* badbf87 nobnago nobnago Thu Jan 3 12:55:42 2013 +0100 Thu Jan 3 12:55:42 2013 +0100 uncomment logs
* 4e4bafe nobnago nobnago Thu Jan 3 11:36:00 2013 +0100 Thu Jan 3 11:36:00 2013 +0100 bump version 2.0
然而,我在 Repo1 的日志中看到的是,您直到大约 4.5 个月后才将您的分叉与 Repo2 同步!:
git datelog -1 nicolas/master
* 5d4ad0f Nicolas Raoul Nicolas Raoul Wed Apr 17 14:40:24 2013 +0900 Wed Apr 17 14:40:24 2013 +0900 Merge branch 'master' of github.com:ankidroid/Anki-Android
我看到你在这期间收到了来自其他分叉的拉取请求。如果 Repo2 旨在成为您项目的规范 repo,那么您应该考虑更频繁地与它同步,以避免您自己的分叉中的历史记录分歧太大。“更频繁”不一定意味着“每周 X 次”,它可能意味着在您接受每个拉取请求之后,而不是稍后执行 X 次拉取请求。