我有两个git回购站,我在本地机器上克隆。我试图从申请一个回购到其他的变化:在git中的另一个本地回购库中引用一个本地回购站中的sha1
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,但它为什么是混帐不承认的SHA1另一个本地回购?原来,如果我用一个分支的名称替换sha1,它会成功,但我需要使用大量的sha1来做到这一点,并且不想为每个分支创建一个分支来引用它们。
这不是你的具体问题的答案,但你不*有*创建分支和获取每一个。你可以只添加'local-repo2'作为远程和'git fetch local-repo2',然后挑选哈希。 –