【发布时间】:2011-08-19 21:03:20
【问题描述】:
我在本地机器上克隆了两个 git 存储库。我正在尝试将更改从一个回购应用到另一个:
cd path/to/local-repo1
git fetch path/to/local-repo2 <sha1>
// cherry-pick from fetch head, etc.
我明白了:
fatal: Couldn't find remote ref <sha1>
fatal: The remote end hung up unexpectedly
我找到了git: Apply changes introduced by commit in one repo to another repo,但为什么 git 无法识别另一个本地 repo 中的 sha1?事实证明,如果我用分支名称替换 sha1,它会成功,但我需要使用大量 sha1 来执行此操作,并且真的不想在每个分支上创建一个分支以引用它们。
【问题讨论】:
-
这不是您特定问题的答案,但您没有有创建分支并获取每个分支。您可以添加
local-repo2作为远程和git fetch local-repo2,然后挑选哈希值。
标签: git repository fetch sha1