A CLI tool that extends Git Flow with automatic remote synchronization, branch cleanup, and enhanced workflow automation for teams.
- Start or finish
feature,release,hotfix, andsupportbranches - Automatically push updates and tags to remote
- Delete remote branches after finishing a flow
- Auto-detect and clean up local branches tracking deleted remotes
- Auto-stash uncommitted changes for safety
- Optional CI/CD trigger via
--ci-url - Dry run and verbose output modes
- Save the script file:
- Make it executable:
chmod +x git-flow-sync-extended.sh
- (Optional) Move it into your
$PATH:sudo mv git-flow-sync-extended.sh /usr/local/bin/git-flow-sync
gitgit-flow(initialized in your repo)- Unix-compatible shell (Bash)
git-flow-sync [--dry-run] [--verbose] [--force] [--ci-url <url>] <start|finish|cleanup> [feature|release|hotfix|support] <branch-name>| Command | Description |
|---|---|
start |
Start a new Git Flow branch and push to remote |
finish |
Finish a Git Flow branch, push target branch and tags, delete remote branch |
cleanup |
Remove local branches that track deleted remote branches ([gone]) |
| Option | Description |
|---|---|
--dry-run |
Show actions without executing |
--verbose |
Show detailed output of every command |
--force |
Auto-delete stale local branches without confirmation |
--ci-url <url> |
Send a POST request to the given URL after finishing a branch |
git-flow-sync start feature navbar-updategit-flow-sync finish release v1.4.0 --ci-url https://ci.example.com/deploygit-flow-sync cleanup --verbosegit-flow-sync cleanup --force- Uncommitted changes are auto-stashed before
finish - Never deletes local branches without prompt (unless
--forceis set) - Supports
--dry-runfor all destructive operations
MIT β Free to use and adapt.
Built to make Git Flow actually flow β cleanly, safely, and with fewer manual steps.