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
~/.bashrc
or equivalent, export an environment variable calledGITHUB_TOKEN
with 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
./bin
to your PATH
If you've done the last step, you can change into that local folder and:
-
run
pull
to fetch the latestmain
for all repositories -
run
status
to quickly find out if all projects havemaster
checked out with a clean working tree. You can pass options that you would normally pass togit status
, such as-s
for short output. -
run
run some command
to run "some command" in each repository -
use
dirty
to 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.