Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import Existing Local Git Master Repo into Gitlab: Git user Access Issues

Tags:

git

gitlab

I have a git master branch on my test server under testvps.subdomain.domain.com:~public_html/domain.com/ZendSkeletonApplication/ . I have Gitlab CentOS rpm up and running on that same server now at http://testvps.subdomain.domain.com:8888

Import Local Master Repo into Gitlab

I need to import this existing local repository into Gitlab (See earlier question on cloning the repo here with ssh. ) on the same test server. This repo is the master branch NOT the original branch origin which is ZendApplication on Github. For passworded access Gitlab suggested a link like https://username:[email protected]/company/project.git Documentation mentions to copy bare repos to /home/git/

What is the best approach?

The user git has been added only somehow the home directory was not created I guess that has to be done manually - see link here . Not sure if this is needed for proper imports though. And this being a master branch would require a different approach to import the existing git repository with 20+ commits it seems. Perhaps I should make the master a new origin? How should I go about doing this?

Update

I have added gitlab .git repo as new remote.

git remote set-url origin [email protected]:root/repo.git
git remote -v
origin  [email protected]:root/repo.git (fetch)
origin  [email protected]:root/repo.git (push)

When I try to push to it I get a request for the password for the git user

git push -u origin master
[email protected]'s password: 

which is not supposed to be needed nor do I have it. How can I fix this?

PS sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production does not work as it mentions bundle as command is missing

like image 429
rhand Avatar asked Jul 29 '14 10:07

rhand


2 Answers

You might want be able to use rake gitlab:import:repos:

  • copy the bare repository under repos_path (/home/git/repositories/group/repo.git). Directory name must end in .git and be under a group or user namespace.
  • run bundle exec rake gitlab:import:repos

The owner will the first admin, and a group will get created if not already existent.

See also: How to import an existing bare git repository into Gitlab?


ONCE YOU HAVE SORTED YOUR USER ACCESS ISSUES:

  1. Create a new project on GitLab with the same name as your local project.
  2. On your local do: git remote add origin git@repo-url:projectpath/projectname.git
  3. git push
like image 39
slonik Avatar answered Oct 29 '22 18:10

slonik