我将从 SVN 切换到 Git,并在中央服务器上安装 Gitosis,以便在 Ubuntu 服务器上建立集中存储库。
我已将所有 SVN 存储库移至新的 Git 存储库并启动,并将所有历史记录移至 Git。
现在我已经将所有存储库迁移到 Git,我想将所有存储库添加到 Gitosis 中以由 Gitosis 管理。
如何将存储库(Git 启动的存储库)移至 Gitosis /srv/gitosis/repositories
并通过 gitosis-admin.git
远程管理它们?
最佳答案
这个想法是在 gitosis-admin 本地(克隆)存储库的 conf/gitosis.conf
文件中声明您的存储库:
[group groupname]
writable = reponame
members = username
git add -A
git ci -m "updated configuration"
git push
,这将创建一个裸存储库,您可以将本地存储库推送到该存储库。
mkdir myproject
cd mypyroject
git init
# do some work, git add and commit files
# Then add your server as a remote and push:
git remote add serveralias git@hostname:reponame.git
git push serveralias master
话虽如此,我发现 gitolite 比 gitosis 更完整,就像所有最近的博客文章所说明的那样:
- A Pure Git Deploy Workflow (with Jekyll and Gitolite)
- Git Repository Server using Gitolite
- Gitolite installation with gitweb and anongit in Gentoo and Debian
您可以从 gitosis to gitolite easily enough 迁移.
关于git - 如何将本地 Git 存储库(具有历史记录)移至远程服务器上由 Gitosis 管理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4172887/