Syncing multiple GitHub repositories at the same time
Last updated
Last updated
If you like to keep your projects separate, and if you have many concurrent projects like I do, and if you are regularly editing all of them, and if you are smart enough to be syncing your web-based work with your computer (you should definitely be doing that), then you will probably discover that GitHub Desktop has no way to sync multiple or all repositories at once.
This is apparently for safety, so that you don't accidentally commit, merge and sync things that you weren't ready to. Personally I find this patronising, as I should be allowed to make my own mistakes. (And surely a versioning control system is the ideal thing to screw up in such a manner?)
So here is a guide on how to create and run a script that automatically updates all your GitHub (or other Git) repos at the same time.
Update ALL of your Git repositories at the same time.
Automate Repository Cloning: Check if a repository is already cloned and clone it if not.
Keep Repositories Up-to-Date: Pull the latest changes if the repository is already cloned.
The guide has clear steps and an easy-to-edit script that you can copy & paste into your own file. The script isn't long, so you can see everything that it is doing.
NOTE: You CAN run Bash shell scripts on Windows! Once you've installed Git on Windows, just right click in the folder and choose "Open Git Bash here":
Edit the repos list and the folder address:
Visit the website to read all the steps and copy the code.