3 ms·
Show HN: Clone all of your GitHub repos at once
- jsnider3 11y agoThis was just a quick tool I made so that I could setup my stuff on a new computer quickly. Hopefully someone else finds it useful.
- archimedespi 11y agoIt's nice! I'm setting up a new Linux install on my workstation, and I found this really useful.
- jsnider3 11y agoThanks, that is literally the situation this was made for.
- jsnider3 11y agoAnyone have suggestions for other features I could add?
- lol768 11y agoIs it possible to use a personal access token in place of a password with this tool in its present state?
- jsnider3 11y agoCurrently, it only does username / password, but PyGithub supports OAuth tokens, so it should be 2-3 lines. Edit: It now supports tokens supplied with a "--token" argument.
- c17r 11y ago2 I can think of: * work with orgs * pull if clone already exists
- jsnider3 11y agoIf you give me a couple minutes I'll add a git pull option. Getting a user's organization repos is something I will also add to the queue. Edit: We now run a git pull in repos by default and it can be disabled with a "--nopull" argument.
- jsnider3 11y agoI added some tentative code to clone org repos, but I haven't been able to test it since I'm not a member of any organizations.
- rhinoceraptor 11y agoIt would be cool to add custom locations for project types, for example cloning any Go repositories to $GOPATH/src/github.com/user/. I usually lay out my directories putting everything under ~/git/, and then I'll have ~/git/js, ~/git/c, ~/git/python, and so on.
- jsnider3 11y agoThis is possible to do, GitHub's API provides access to the language breakdown of a given repository. It could probably be done through some kind of ruleset file we go through that maps conditions to directories. I'll think about it, but I'm not sure there's enough demand. If you do this in fork, I'd be willing to take it.
- jsnider3 11y agoThinking about it some more, this sounds like a good idea. I'll add it to version 2.
- glenda 11y agoThis looks nice, but I typically use something like this: curl https://api.github.com/users/[username]/repos | jq .[].clone_url | xargs -n 1 git clone Only works for public repos though.
- jsnider3 11y agoThat's clever and is the first time I encountered jq, so thanks for introducing me to something new. Personally, I prefer python solutions to shell solutions, since its easier to maintain / add features.
- archimedespi 11y agoGood solution! You can use this for orgs as well, just curl https://api.github.com/orgs/[orgname]/repos instead.