我的测试服务器上有一个 git master 分支在 testvps.subdomain.domain.com:~public_html/domain.com/ZendSkeletonApplication/
下.我现在在同一台服务器上启动并运行 Gitlab CentOS rpm http://testvps.subdomain.domain.com:8888
将本地Master Repo导入Gitlab
我需要将这个现有的本地 存储库导入同一台测试服务器上的 Gitlab(请参阅前面关于使用 ssh 克隆存储库 here 的问题。)。这个 repo 是主分支而不是 Github 上的 ZendApplication 的原始分支源。对于密码访问,Gitlab 建议使用类似 https://username:password@gitlab.com/company/project.git
的链接文档提到将裸仓库复制到/home/git/
什么是最好的方法?
只是以某种方式添加了用户 git 未创建主目录我想这必须手动完成 - 参见链接 here .不确定是否需要正确导入。作为一个主分支,似乎需要一种不同的方法来导入现有的 git 存储库,其中包含 20 多个提交。 也许我应该给主人一个新的起源?我应该怎么做呢? 罢工>
更新
我已经添加了 gitlab .git repo 作为新的远程。
git remote set-url origin git@testvps.sub.domain.com:root/repo.git
git remote -v
origin git@testvps.sub.domain.com:root/repo.git (fetch)
origin git@testvps.sub.domain.com:root/repo.git (push)
当我尝试推送到它时,我收到了 git 用户密码的请求
git push -u origin master
git@testvps.sub.domain.com's password:
不需要,我也没有。我该如何解决这个问题?
附言sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
不起作用,因为它提到 bundle as command is missing
最佳答案
您可能希望能够使用 rake gitlab:import:repos :
- 将裸存储库复制到
repos_path
(/home/git/repositories/group/repo.git
) 下。目录名称必须以.git
结尾并位于组或用户命名空间下。 - 运行
bundle exec rake gitlab:import:repos
所有者将是第一个管理员,如果还不存在,将创建一个组。
另请参阅:How to import an existing bare git repository into Gitlab?
关于git - 将现有的本地 Git Master Repo 导入 Gitlab : Git user Access Issues,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25012968/