Last active
May 5, 2018 11:07
-
-
Save rrrnld/4766f177077b98883e91b4726821996f to your computer and use it in GitHub Desktop.
Move a folder of local bare git repos over to gitea
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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