Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何用Subgit钩住SVN更新_Git_Subgit - Fatal编程技术网

如何用Subgit钩住SVN更新

如何用Subgit钩住SVN更新,git,subgit,Git,Subgit,我将Subgit设置为在SVN和Git之间同步。 Subgit运行守护进程以侦听SVN更新 我想在守护进程将SVN合并到Git存储库之后运行一些东西, 我该怎么办?SubGit 2.0.x从Subversion存储库获取新修订版时不会触发任何挂钩。有一个功能请求,请随意投票: 作为一种解决方法,我建议您使用定期运行以下命令的cron作业: subgit fetch <GIT_REPO> SubGit <version> Translating SVN revisions

我将Subgit设置为在SVN和Git之间同步。
Subgit运行守护进程以侦听SVN更新

我想在守护进程将SVN合并到Git存储库之后运行一些东西,

我该怎么办?

SubGit 2.0.x从Subversion存储库获取新修订版时不会触发任何挂钩。有一个功能请求,请随意投票:

作为一种解决方法,我建议您使用定期运行以下命令的cron作业:

subgit fetch <GIT_REPO>
SubGit <version>
Translating SVN revisions to Git commits...
  rN => <hash>
Done.
$ cd <working_tree> && git push <remote> +:refs/subgit/command/fetch-sync
remote: Synchronizing SVN and Git...
remote:   translating SVN revisions to Git commits...
remote:     translated revision N to commit <hash>
remote: ... done.
subgit获取
亚吉特
正在将SVN修订转换为Git提交。。。
rN=>
完成。
您还可以通过运行以下命令远程触发Git SVN sync:

subgit fetch <GIT_REPO>
SubGit <version>
Translating SVN revisions to Git commits...
  rN => <hash>
Done.
$ cd <working_tree> && git push <remote> +:refs/subgit/command/fetch-sync
remote: Synchronizing SVN and Git...
remote:   translating SVN revisions to Git commits...
remote:     translated revision N to commit <hash>
remote: ... done.
$cd&&git-push+:refs/subgit/command/fetch-sync
远程:正在同步SVN和Git。。。
远程:将SVN修订转换为Git提交。。。
远程:要提交的已翻译版本N
远程:。。。完成。
通过解析子Git的输出,可以了解它是否获取了新的SVN修订

如果您打算使用此类定期作业,禁用背景翻译过程是有意义的,因为它不再是必需的:

$ edit <GIT_REPO>/subgit/config
# [daemon]
#     idleTimeout = 0
$ subgit install <GIT_REPO>
$edit/subgit/config
#[守护进程]
#idleTimeout=0
$subgit安装

你能描述一下你将要实现的目标吗?您是否在不同的机器上托管Subversion和Git存储库?@vadishev就是这样。我试着让Gerrit和Subgit一起工作。首先,我使用Subgit设置git存储库,以同步远程SVN repo。然后我用a做了一个git镜像B供Gerrit使用。到目前为止,我使用Gerrit Replication插件将镜像B推送到A,但通过命令
git remote update
从A手动更新B以合并SVN中的更改。如果Subgit从SVN更新并调用B自动更新,那将是完美的。我无法从您的示例中找到正确的GIT_REPO参数,但是一个简单的
Subgit获取。
帮了我的忙。