FAP is a Bash script designed to simplify updating multiple Git repositories within a specified directory. It scans for Git repositories, presents a list of options, and allows you to update selected repositories or all at once.
./fap.sh [TARGET_DIR]
TARGET_DIR
: The directory where the script will search for Git repositories. If no directory is specified, it defaults to the current directory.
-h
,--help
,--usage
: Display the help message and exit.-a
,--all
: Update all repositories without prompting.--dry-run
: List repositories that would be updated without updating.
all
: Update all repositories.0 2 6-4
: Update repositories by specifying indices and ranges (e.g., repositories 0, 2, and 6 to 4).
- The script searches for Git repositories (
.git
directories) in the target directory. - It lists all found repositories by index.
- You input either
all
to update all repositories or provide indices and ranges (e.g.,0 2 6-4
). - The selected repositories are updated in parallel using
git pull
.
./fap.sh ~/projects
Found Git repositories in ~/projects:
[0] ~/projects/repo1/.git
[1] ~/projects/repo2/.git
[2] ~/projects/repo3/.git
Enter repositories to update (e.g., 'all', '0 2 6-4'): all
Updating ~/projects/repo1
Updating ~/projects/repo2
Updating ~/projects/repo3
Update complete.