How to add existing repository to gitea from filesystem?

Viewed 470

I have some bare git repository on my filesystem where users do pull/push. I install gitea and can't find how to add it to gitea. Other git-management systems have something like "add repository from filesystem", "scan directory", etc. which added existing repo to system. How to add it in gitea?

1 Answers

At the moment I migrate from Filesystem Repositorys to Gitea.

How this could be done is heavily discussed here (we used SSH), where I got the basis for my approach.

The following steps worked for me:

  1. clone the repo.git folder to another location git clone path/to/repo.git
  2. create an empty repo in Gitea. Either by hand or using the api, e.g. call curl -X POST "http://localhost:3000/api/v1/user/repos" -H "accept: application/json" -H "Authorization: token MY_TOKEN*" -H "Content-Type: application/json" -d {\"name\":\"test\"} -i
  3. push the repo to gitea
  • git remote add neworigin "http://localhost:3000/username/test.git"
  • git push neworigin --all
  • git push neworigin --tags

*https://docs.gitea.io/en-us/api-usage/

Related