https://github.com/salvatorecorvaglia/git-sweep
Git Bulk Branch Updater
https://github.com/salvatorecorvaglia/git-sweep
bash git
Last synced: 11 months ago
JSON representation
Git Bulk Branch Updater
- Host: GitHub
- URL: https://github.com/salvatorecorvaglia/git-sweep
- Owner: salvatorecorvaglia
- Created: 2025-05-06T11:29:22.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-06T17:22:42.000Z (about 1 year ago)
- Last Synced: 2025-06-06T18:30:08.805Z (about 1 year ago)
- Topics: bash, git
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Git Bulk Branch Updater
This Bash script recursively scans a base directory for Git repositories and updates each local branch that has a tracking upstream branch. It fetches the latest changes and performs **fast-forward-only merges** to ensure the local branches are synchronized with their upstream counterparts.
## Features
- Detects all Git repositories under a given base directory.
- Skips repositories with uncommitted changes.
- Automatically fetches updates from all remotes.
- Updates all branches that have tracking branches, using fast-forward-only merges.
- Supports a dry-run mode to preview actions without making changes.
- Gracefully handles detached HEADs and non-fast-forward cases.
- Exits with non-zero status if any branch could not be fast-forwarded.
- Portable and tested on macOS, Linux, and WSL environments.
## Requirements
- Bash
- Git
## Usage
```bash
./git-pull-all.sh [--dry-run] [--dir ]