7

I have a few bare Git repos on a host. Later I installed Gogs on same host. I configured it to use the exact same folder for storing repositories, where my bare repos are already residing.

How can I import them? I does not need to "import" anything in fact. I just want Gogs to recognize their existence.

SzG
  • 12,333
  • 4
  • 28
  • 41

1 Answers1

1

I moved my repositories from one gogs-instance to another gogs-instance. But this should work with github, gitlab or other services as well.

Mirror the source repository to a bare git repo:

git clone --mirror git@source-gogs:project.git

Push the local bare git repo as mirror to the new destination repo:

cd project.git
git push --mirror git@dest-gogs:project.git

Note: Do not use git push --mirror if you did not clone the repo with git clone --mirror. Also, git clone --mirror is preferred over git clone --bare as it will clone all git notes and attributes as well.

elim
  • 1,404
  • 1
  • 16
  • 17