Shell script for update all git repositories placed in specified folder
This script helps to automatically update all repositories located in a specific folder from remote repositories.
This is typically needed in a situation where you have many repositories cloned locally into a folder, such as a collection of various utilities, and you want to update all repositories to the latest version from a remote repository.
This script does three simple things on each repository in the source folder:
git fetch --all
git reset --hard HEAD
git pull
*It works with GitHub, GitLab, BitBucket or your remote Git Server.
get reset --hard HEAD removes all changes made so far locally!
Be careful not to lose your data!
It is recommended to apply this script only to collections of local repositories that are not actively edited.
- Clone this repository
- Run 'bash update.sh ', aka this, and wait:
bash update.sh "/Volumes/Transcend/repos"
- Bingo!
Also I use github-starred-repos-loader and github-starred-repos-builder scripts to pull my starred GitHub collected repos locally and generates repos description in Markdown format.