Skip to content

Instantly share code, notes, and snippets.

@heyarne
Last active May 5, 2018 11:07
Show Gist options
  • Save heyarne/4766f177077b98883e91b4726821996f to your computer and use it in GitHub Desktop.
Save heyarne/4766f177077b98883e91b4726821996f to your computer and use it in GitHub Desktop.
Move a folder of local bare git repos over to gitea
# assumes you have httpie installed: https://httpie.org/
set GITEA_URL "your.gitea.server"
set USER "YOUR_USERNAME"
set PASS "YOUR_PASSWORD"
for f in (find . -type d -name '*.git')
set --local name (basename $f | sed 's/\.git//')
pushd $f
http -a $USER:$PASS POST https://$GITEA_URL/api/v1/user/repos name=$name
git remote add origin git@$GITEA_URL:$USER/$name.git
git push origin master
popd
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment