Gitflow is a professional command line tool that turns everyday Git workflows into single intentional commands.
Remove friction from your daily development work.
Modern developers repeat the same Git actions constantly.
- Switch branch
- Pull latest changes
- Create a feature branch
- Push and set upstream
- Open a pull request
- Clean up old branches
- Prepare releases
- Generate changelogs
Each task is simple in isolation, but together they create constant cognitive overhead.
Gitflow solves this by encoding team conventions and best practices into a single tool that understands intent instead of raw Git commands.
Gitflow is a smart workflow manager built on top of Git.
It provides
- High level workflow commands instead of low level Git invocations
- Safe automation with strong defaults and guardrails
- A consistent user interface across all commands
- Deterministic release and versioning logic
- Optional GitHub and GitLab integration
- CI friendly behavior for automation and pipelines
You say what you want to do.
Gitflow figures out how to do it safely.
Example
Instead of manually running several Git commands to start a feature branch, you run
gitflow start user auth
Gitflow handles base branch selection, cleanliness checks, branch naming, and pushing.
Gitflow never rewrites history silently.
It refuses dangerous operations by default.
Destructive actions require explicit confirmation.
Given the same repository state, Gitflow always produces the same result.
This is critical for releases and CI usage.
Every command uses the same UI system.
Tables look the same.
Headers look the same.
Errors are consistent and actionable.
- Status and diagnostics: Repository health checks, including
gitflow statusandgitflow doctor. - Branch management: Start, sync, commit, clean up, and inspect branches safely.
- Pull request workflows: Create, list, and view PRs via GitHub or GitLab.
- Release system: Deterministic versioning, changelogs, tags, and publishing.
- CI-friendly output: JSON, env, no-color, and non-interactive modes.
Clone the repository
git clone https://github.com/C-NASIR/gitflow
cd gitflowBuild the binary
go build -o gitflow .Or install globally (recommended)
go install .Ensure the Go bin directory is on your PATH (zsh)
echo 'export PATH="$PATH:$(go env GOPATH)/bin"' >> ~/.zshrc
source ~/.zshrcVerify the install
gitflow versionGitflow uses a YAML configuration file named .gitflow.yml.
Configuration is optional.
Defaults are provided for everything.
Example configuration
provider:
type: github
token_env: GITHUB_TOKEN
owner: myorg
repo: myrepo
branches:
feature_prefix: feature/
main_branch: main
workflows:
start:
base_branch: main
auto_push: true
cleanup:
merged_only: true
age_threshold_days: 30
protected_branches:
- main
ui:
color: true
emoji: false
verbose: falseYou can generate a starter config using
gitflow init
UI behavior can be controlled via config, environment variables, or CLI flags.
Precedence order
- CLI flags
- Environment variables
- Config file
- Defaults
Supported controls include
Color output Emoji usage Verbose logging
This makes Gitflow usable both locally and in CI.
gitflow versionprints the gitflow build version.gitflow statusshows the repository status summary.gitflow doctorruns diagnostics without mutating the repo.gitflow initwrites a starter.gitflow.ymlfile.gitflow config showprints the resolved configuration.gitflow config validatevalidates configuration and reports errors.
gitflow start <name>starts a new branch using conventions.gitflow syncsyncs the current branch with the base branch.gitflow commitcreates a commit using conventions or prompts.gitflow cleanupdeletes merged or stale branches safely.gitflow branch listlists local branches with age and ahead/behind.
gitflow pr createcreates a pull request for the current branch.gitflow pr listlists pull requests from the provider.gitflow pr view <number>shows a pull request by number.
gitflow provider checkvalidates provider credentials and access.
gitflow release previewpreviews the next version and changelog.gitflow release createcreates an annotated tag with changelog.gitflow release changelogoutputs the changelog since last release.gitflow release versionprints the next release version.gitflow release publishpublishes release notes to the provider.
This project is heavily tested.
Tests include
- Unit tests for Git helpers
- Workflow level tests using temporary Git repositories
- Provider tests using mocked HTTP servers
- Deterministic release computation tests
All tests run with
go test ./...
No network access is required.
MIT License
Use it. Learn from it. Extend it. Ship better tools.