fetch-stars clones all most of your starred GitHub projects
ATTENTION: Currently under heavy rewriting. THINGS ARE BROKEN!
I enjoy reading other people's code. Thanks to GitHub it isn't such a hassle to finde some. So when I get my hands on particularly remarkable code (or just code I want to look at again some time later), I use GitHub's 'starring' feature, similar to a bookmark. And I use this feature a lot.
To be able to browse the code offline and with my cli-tools, I always make 'git clone' my starred repositorys. But sometimes, especially with many stars, this becomes monotonous, boring and repetive. So I wrote this script.
Dependencies:
$ wget https://raw.github.com/engeld/fetch-stars/master/fetch-stars.sh
$ chmod +x ./fetch-stars.sh
./fetch-stars.sh [-u USER] [-d DIRECTORY]
If you have two-factor-auth enabled (like myself):
- create a "Personal Access Token" on this settings page
- use the created "Personal Access Token" as username
- use 'x-oauth-basic' as password
- Loop through all of the given users starred projects
- For each one, check if it already exists in the target directory
- If it doesn't exists yet, clone it there
- If it already exists, update it
- For each one, check if it already exists in the target directory
- Currently, only the first page of one's starred repo-pages is being processed
- No full sync - Meaning if some of the repos already exist locally, there may be problems
- Implement Sync
- Full OAUTH/GitHub-Auth support
- Few more commandline-switches
- USE GETOPTS
- GitHub API: Repository Starring
- GitHub API issue - listing starred repos
- An introduction to curl using GitHub's API
- GitHub API: OAuth - I've read it hundreds of times and it's still a mystery to me
- Advanced Bash Scripting Guide - my bible