SUBGIT镜像远程SVN仓库到本地

2015-02-01  本文已影响0人  PerHar3
  1. 更改subgit配置

6.1. 编写hook
为了使svn和Git仓库之间进行同步,Subgit 将如下hook装入Git仓库:

Hook的存在对SubGit稳定来说是至关重要的,用户不能修改或删除这些Hook。如果需要,上述Hook名称需置为user-,并且适时被调用。subgit安装命令兼顾现有Hook和自动将其内容到对应的user- 脚本。(见图5.2,“库安装完成后命令”)。
下表为标准Hook和Subgit安装后hook的名称对应关系,应以hook功能后安装subgit。钩的参数和返回代码的处理规则不受subgit。钩,该表中未列出的不是由subgit及其标准文件名称中使用不改变。

standard hook name hook name after SubGit is installed
pre-receive user-pre-receive
post-receive user-post-receive

On Windows OS .cmd or .bat extension should be added to Subversion hook file names.
6.2. APPLYING CONFIGURATION CHANGES

SubGit configuration could be changed after SubGit is installed into repository. Some of the changes become effective immediately and others require subgit install or subgit install --rebuild command to be executed in order for the changes to be applied.
Changes that become effective immediately:
Modification of the authors mapping file (subgit/authors.txt)
Modification of the password credentials file (subgit/passwd)
Modification or creation of the user-* hook scripts
Changes that become effective after 'subgit install' is run:
Modification of the core.authorsFile option in the subgit/config file
Modification of the svn.fetchInterval option option in the subgit/config file
Modification of the [auth] section options in the subgit/config file
subgit install command will validate changes made to the subgit/config file and will apply these changes. Background translation process will be restarted if needed.
Other configuration changes: In case more changes have to be made, in particular, changes to the branches mapping in subgit/config file, then the easiest way would be to reinstall SubGit following standard configuration stages (see Section 5.1, “Installation Stages”). It is not possible to update branches mapping for a Git repository where SubGit is already installed. To stop background translation process, run subgit uninstall command on a Git repository.

  1. 卸载 SUBGIT
    通过uninstall命令可以禁用同步功能或者将subgit完全移除。
    下面运行的没有选项的卸载命令将进行中的事务终止掉后又移除了hook。

$ subgit uninstall repository.git
SubGit version 2.0.0 ('Patrick') build #7777`
About to shut down background translation process.
Shutdown request sent to background translation process (pid 4900).
Background translation process has received shutdown request and will exit NOW.
SHUTDOWN SUCCESSFUL
SubGit hooks have been removed from Git repository:
/var/git/repository.git
Subversion and Git are no longer kept in sync.

当svn和git不再同步时,运行subgit install命令可使他们重新同步。
卸载时使用--purge选项可以完全移除subgit。它将会移除:

  1. 配置要求
    Subgit 可以运行在大部分流行的系统上。
    服务器需求如下:

Windows XP以及其他更高版本, Linux 或者OS X
Oracle Java 1.5 以及其他更高版本
内存大小至少K * 256Mb,K是指迁移到subgit的svn仓库数目。

SubGit 2.0使用内置二进制可执行代码包来执行hook脚本,所以当用户进行push操作的时候将不需要花费额外的时间来启动JVM (假设后台进程已经在启动中).。一些特殊的系统可能不能执行二进制代码包,SubGit会去调用基于java的hook. 在这种情况下,所需内存将增至N*32Mb ,此时N 是正在做push操作的最大进程数。
所需内存包括物理内存和缓存, 因此所需内存只是给用户一个subgit内存参考峰值, 但这并不意味着服务器需要额外增加物理内存。

12 安装 SUBGIT TOOL
在安装SubGit 到svn仓库前,请确保已经安装了Subgit tool并且服务器符合系统需求配置(参见第十一章)。下面介绍下如何安装Subgit tool。
需要先将subgit tool
基于Debian或者Ubuntu的系统:

现在就可以在命令行红执行subgit命令了,尝试运行一下subgit --version .如果要升级SubGit tool请重复执行上面的步骤即可。

基于Linux和OS X:
*必要时请先从下载页面下载最新的Java SE JDK;

现在就可以在命令行红执行subgit命令了,尝试运行一下subgit --version .如果要升级SubGit tool,先将/opt/subgit下的文件清除,然后重复执行上面的步骤即可。

Windows 系统:

现在就可以在命令行红执行subgit命令了,尝试运行一下subgit --version .如果要升级SubGit tool,先将C:\Program Files\SubGit下的文件清除,然后重复执行上面的步骤即可。

13 寻求帮助

来信请致support@subgit.com。 我们很乐意收到您向SubGit提出的问题或者建议. 我们期待您的反馈!
如下链接可以帮助您向我们提出问题或者建议

上一篇下一篇

猜你喜欢

热点阅读