如何将现有的 gitolite3 安装成功移动到新服务器?
我按照给出的指示这里。
然而,从旧服务器复制所有存储库(包括原始 gitolite-admin)并push -f
从原始 gitolite-admin 存储库克隆后,gitolite3 不会.gitolite
从原始 gitolite-admin 更新服务器上的隐藏目录。
以下是我运行的具体命令
$ git clone git://github.com/sitaramc/gitolite
Cloning into 'gitolite'...
$ gitolite/install
use the following full path for gitolite:
/Users/git/gitolite/src/gitolite
$ gitolite setup -pk admin.pub
Initialized empty Git repository in /Users/git/repositories/gitolite-admin.git/
Initialized empty Git repository in /Users/git/repositories/testing.git/
WARNING: /Users/git/.ssh/authorized_keys missing; creating a new one
该密钥admin.pub
与我用于原始设置的密钥完全相同。
然后,我用原始服务器中的存储库替换生成的存储库目录的内容(覆盖新生成的gitolite-admin
存储库)。
$ gitolite setup
此命令没有改变隐藏.gitolite
目录,以下几行被添加到日志中/Users/git/.gitolite/logs/gitolite-2013-07.log
013-07-09.18:03:10 19151 cli gitolite setup
2013-07-09.18:03:10 19151 system,git add conf/gitolite.conf
2013-07-09.18:03:10 19151 system,gitolite compile
2013-07-09.18:03:10 19151 system,gitolite trigger POST_COMPILE
2013-07-09.18:03:10 19151 system,/Users/git/gitolite/src/triggers/post-compile/ssh-authkeys,POST_COMPILE
2013-07-09.18:03:10 19151 system,/Users/git/gitolite/src/triggers/post-compile/update-git-configs,POST_COMPILE
2013-07-09.18:03:10 19151 system,/Users/git/gitolite/src/triggers/post-compile/update-gitweb-access-list,POST_COMPILE
2013-07-09.18:03:10 19151 system,/Users/git/gitolite/src/commands/access,%,gitweb,R,any
2013-07-09.18:03:11 19151 system,/Users/git/gitolite/src/commands/git-config,-r,%,gitweb\.
2013-07-09.18:03:11 19151 system,/Users/git/gitolite/src/triggers/post-compile/update-git-daemon-access-list,POST_COMPILE
2013-07-09.18:03:11 19151 system,/Users/git/gitolite/src/commands/access,%,daemon,R,any
2013-07-09.18:03:11 19151 END
gitolite-admin
然后在另一台机器上,我检查了原始副本,并运行:
$ git push -f
Everything up-to-date
答案1
gitolite-admin
正如 Etan Reisner 在评论中提到的那样,将内容推送到新服务器的新远程服务器是关键部分。在签出原始副本的本地计算机上,运行:
$ git remote add newserver [email protected]:gitolite-admin.git
$ git push newserver -f
Counting objects: 281, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (240/240), done.
Writing objects: 100% (281/281), 27.83 KiB | 0 bytes/s, done.
Total 281 (delta 85), reused 5 (delta 0)
To [email protected]:gitolite-admin.git
+ d7502b8...de05d2e master -> master (forced update)
然后,服务器端的隐藏.gitolite
目录将使用存储库的原始内容进行更新gitolite-admin
。