-1

I have a git repository called "shop" that has the remote "oldserver.com"

remote.origin.url=git@oldserver.com:shop.git

How do I create the shop.git folder from my local repository, so I can load it on my "newserver.com" (that uses gitolite or gitosis) so we can use that as a new remote?

rubo77
  • 19,527
  • 31
  • 134
  • 226
  • There is no such thing as a .git file. "shop.git" is the name of the remote repository on your old server. If you want to use your new server as a remote, just create a repository there. You can call that one "shop.git" too, or you can call it something completely different. – David Mar 18 '14 at 23:08
  • Is there any good reason for using gitosis instead of gitolite? – michas Mar 18 '14 at 23:19
  • I just stated it being called like that cause I got stuck searching. I guess many others will have the same problem. – rubo77 Mar 18 '14 at 23:19
  • gitosis vs. gitolite: http://stackoverflow.com/a/10888358/1870481 – michas Mar 18 '14 at 23:29

1 Answers1

1

If I understood your question correctly, you have three repositories:

  • a remote repository at oldserver.com, which was used to host your code
  • a remote repository at newserver.com, which you want to host your code now
  • a local repository, which has oldserver.com defined as remote "origin"

Assuming you already pulled everything from oldserver into your local repository and you already created the new repository in gitosis on newserver, and you configured gitosis to allow you access to that new repository, you can do:

git remote add newserver git@newserver.com:shop.git
git push newserver master

If you have any other branches or tags, just push them, too.


If you need to manually create the repository on newserver you can use:

git clone --mirror git@oldserver.com:shop.git

In this case there is no need to push anything.

michas
  • 25,361
  • 15
  • 76
  • 121