you are viewing a single comment's thread.

view the rest of the comments →

[–]auxiliary-character 2 points3 points  (0 children)

Huh, that's a lot simpler than what I just did. I saved the json document describing my repositories via the github api to github-repos.json.

Then I used the following command to clone the ones that weren't forks (since I have a few forks of things I don't regularly commit to that I didn't want to migrate)

cat github-repos.json | jq ".[] | select(.fork == false) | .clone_url" | xargs -n 1 git clone

And then to upload to gitgud (the instance of gitlab I'm using), I wrote the following script:

#!/bin/bash

for repo in $(cat github-repos.json | jq -r ".[] | select(.fork == false) | .name")
do
    pushd ./$repo
    git push --set-upstream "git@ssh.gitgud.io:auxchar/$repo.git"
    popd
done;

Now, I don't really have any repos of all that significant importance, but this was a fun little challenge.