Process multiple Git repos from top-level script (pull_push_all.sh
).
The pull_push_all.sh
will perform git pull & push only on main/master branch. And will list any untracked files. Last but not least, the script will give a warning when the current checked-out branch is NOT main or master. That project will be skipped in this case.
The goal of this script is to sync your Git projects with the remote Git server, especially once you got a lot of Git projects.
NOTE 1: This script will NEVER automatically commit changes.
NOTE 2: Processing each repo will take less than 1 second. Efficiently: O(n)
Example:
.
├── pull_push_all.sh
├── project1
│ ├── .git
│ └── README.md
└── project2
├── .git
└── README.md