This little post could be considered a super late follow up to a previous post on git, or a standalone post. Kind of like the format The Simpsons are made in (if they still make The Simpsons, goddamn I feel old right now) whatever you can read the other post or don't I don't care, make Up your own mind!
Microservices and the huge amount of repos to keep up to date as a developer
It's really a time eater to keep track of all the updates if you work in a big organisation or getting setup when starting a new job.
Downloading all repos with one cmd
Keeping all the repos in your workspace up to date with another.
for the downloading part I started building a fix. Ended up with a line of Ruby that could make Matz Matsumoto cry, so instead i can suggest the Clone org npm package by Leonardo Tegon Tegon @ Github it's great package with nice options and docs.
For the keeping repos up to date i built a solution myself by the super sexy name update all repos.
Get all your repos up to date
Automate the chore of keeping your workspace up to date.
- Update all the repos in your workspace
For this script to work, you need to have bash and git installed (Only tested on mac)
none, run as is from workspace root
How it works
Place the script named get-all-updates.sh in the workspace root run it.
It will save all folders in its current path, enter the folders one. first check is there a .git folder. If it it, it will check is the current branch master. If that also is true, it will do a git pull origin master. then exit the folder and do the same in the next folder.
workspace root ├── Project | |── .git/ │ ├── README.md │ ├── node_modules │ ├── package.json - Here it will check if the current branch is master…
Essentially it's just a plain ol bash script that enters every folder in the folder where its run, it does some checks (like: is this folder connected to a repo thats on the master branch) if the conditions are true, do a pull from remote, then exit the current folder and repeat in the next.
It's MIT license and highly hackable, The plan is to turn it into a global npm package so the script can run in any folder without needing the actual script the root folder, but atm the actual script is needed. Still it beats doing stuff yourself 😋
So feel free to grab a copy 👍 Open up a pr if you feel like there is something you want to improve or contribute with!
And as always have a nice day and go Git them 😎