A couple scripts to quickly fetch & update all repositories in this organization. pull script is written to work with all repositories in the same organization as this repository.
NOTE: These scripts have only been tested on macOS
First, set up a token for pulling repositories:
-
Click "Generate new token"
-
Give it a good "Note", like "why does GitHub v4 require a token just to view public repositories omg"
-
Don't check any boxes; it's just pulling public repos
-
Scroll down and hit "Generate token"
-
In your
~/.bashrcor equivalent, export an environment variable calledGITHUB_TOKENwith the value of your new tokenGITHUB_TOKEN=the_value_github_gave_you
Now install some dependencies & clone this repo into a sensible location:
- Install prerequisites:
brew install jq - Must have ssh key added to GitHub
- Set up a new directory where you want to clone only the repositories in this org
- Clone this repository into that new directory
- Optionally: add
./binto your PATH
If you've done the last step, you can change into that local folder and:
-
run
pullto fetch the latestmainfor all repositories -
run
statusto quickly find out if all projects havemasterchecked out with a clean working tree. You can pass options that you would normally pass togit status, such as-sfor short output. -
run
run some commandto run "some command" in each repository -
use
dirtyto do things like quickly commit a bunch of changes. Example:for x in $(dirty); do (cd $x && git add --all && git commit -m "cool" && git push); done
If you don't complete the last step, you will have to type ./bin/pull and
./bin/status instead.