2013-03-25 67 views
1

我想将所有git笔记文档(refs/notes/*)从一个中央git存储库转移到另一个中央git存储库。在2个中央git服务器之间复制Git笔记

假设git中央服务器AB,我想复制从AB git笔记。

我试图用类似的选项:

  • git push remoteB refs/notes/*:refs/notes/*; git push --mirror(此选项的功能,但它删除额外的裁判,例如分支,即不存在A);
  • git push --all(此选项不会保持git笔记同步,但在保持refs/heads同步的情况下运行良好)在提交后git挂钩中。

[[email protected] modeln50.git]$ GIT_TRACE=1 git push 
source +refs/notes/*:refs/notes/* 
trace: built-in: git 'push' 'source' '+refs/notes/*:refs/notes/*' 
trace: run_command: 'ssh' '-p' '8081' 'hdqpdsource1.modeln.com' 'git-receive-pack '\''/modeln56.git'\''' 

它是正确拿起遥控器名称,但该项目的名称是错误的(modeln56),此外,命令只是挂起没有任何输出。

+0

与http://article.gmane.org/gmane.comp.version-control.git.user/4524一样,你可以在GIT_TRACE环境变量设置为1的情况下运行'git push'和看看什么refspecs真的传递给'git send-pack'? (注意自我:gerrit评论说明:https://review.typo3.org/Documentation/refs-notes-review.html) – VonC 2013-03-26 07:34:26

+0

嗨冯... thnaks为您的评论...这里是输出:[git @ hdqpdqaapp5 modeln50.git] $ GIT_TRACE = 1 git push source + refs/notes/*:refs/notes/* trace:built-in:git'push''source''+ refs/notes/*:refs/notes/*' trace:run_command:'ssh''-p''8081''hdqpdsource1.modeln.com''git-receive-pack'\''/ modeln56.git'\'''它正在拾取远程名称正确,但是,项目名称是错误的(modeln56),此外,该命令只是挂起没有任何输出... – user1920646 2013-03-26 14:53:32

+0

好吧,什么'git远程-v'返回(当你的本地克隆执行时)? – VonC 2013-03-27 06:13:45

回答

0

这应该推动所有你想要的(笔记和头):

git push remoteB 'refs/notes/*:refs/notes/*' 'refs/heads/*:refs/heads/*' 

,也可按通过增加的Refspec 'refs/tags/*:refs/tags/*'标签。

如果您想避免输入refspecs列表,您可以设置config remote.remoteB.push