git - 将现有的本地 Git Master Repo 导入 Gitlab : Git user Access Issues

标签 git gitlab

我的测试服务器上有一个 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/

相关文章:

git-p4 迁移不同子目录下的分支

windows - scoop 安装了 git bash : "Open Git Bash" here context menu

docker - Gitlab-runner,docker :20. 10.2-dind 显示错误,无法连接到位于 tcp://docker:2375 的 Docker 守护进程

gitlab - 将 mylyn Gitlab 连接器连接到 Eclipse 时出错

git - 运行交互式 rebase 时编辑器自动关闭

java - 如何将现有的 IntelliJ Java 项目添加到 git?

node.js - 在 GitLab CI 中为 Node.js 应用程序构建 Docker 镜像

git - 只允许在 master 上进行经过验证的提交

ios - 没有 :tag 的 cocoapod 获取最新代码的语法

android - 运行仪器测试 ionic Gitlab CI 时出现不兼容的 AVD 错误