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?
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:
Clone the repo.git folder to another location git clone path/to/repo.git
Create an empty repo in Gitea. Either by hand or using the api
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\": \"REPO_NAME\"}" \
-i
Optionally transfer to a organization
curl \
-X POST "http://localhost:3000/api/v1/repos/CURRENT_OWNER/REPO_NAME/transfer" \
-H "accept: application/json" \
-H "Authorization: token MY_TOKEN*" \
-H "Content-Type: application/json" \
-d "{\"new_owner\": \"NEW_ORGANIZATION_OR_INDIVIDUAL\"}" \
-i
Push the repo to gitea
git remote add neworigin "http://localhost:3000/username/test.git"git push neworigin --allgit push neworigin --tags*https://docs.gitea.io/en-us/api-usage/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With