add cloned gits to personal Gitlab

时光毁灭记忆、已成空白 提交于 2020-01-02 07:23:13

问题


I own a Gitlab account. In a running repository I have cloned projects from github but on git add . they won't be tracked. How do I add cloned projects to my Gitlab account?

git branch -vva

* master                c9ef011 [origin/master] te
  remotes/origin/master c9ef011 te

回答1:


Once you initialize a project in GitLab, you'll see a page like this:

The important part is adding the remote:

git remote add gitlab git@mygitlaburl:namespace/myproject.git

You'll need to add your public key by clicking on Profile Settings > SSH Keys > Add SSH Key.

Here are complete instructions: How To Use the GitLab User Interface To Manage Projects

UPDATE:

Your problem is explained here: Git repository within Git repository, which links to here: Nested GIT repo gotchas!




回答2:


A convenient option if you have many repos is to mass import:

  • go to the directory of a namespace (user or group), e.g. /home/git/repositories/username
  • get the bare repo: git clone --bare http://github.com/me/project. The created repo will end in .git and this is required.
  • run bundle exec rake gitlab:import:repos RAILS_ENV=production. The GitLab projects will get automatically created on the datbase for you under the user username.


来源:https://stackoverflow.com/questions/26567492/add-cloned-gits-to-personal-gitlab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!