Git Command Reference

searchable reference with syntax, examples, and common flags

Git Workflow
Working Directory Staging Area Local Repository Remote Repository add commit push fetch/pull checkout / restore
No commands match your search.
Common Workflows
Feature Branch Workflow
1. git checkout -b feature/my-feature - create feature branch
2. Make changes, stage with git add -p
3. git commit -m "Add feature" - commit work
4. git push -u origin feature/my-feature - push branch
5. Open pull request, get review
6. git checkout main && git pull - update main
7. git merge feature/my-feature or squash merge via PR
8. git branch -d feature/my-feature - clean up
Hotfix Workflow
1. git checkout main && git pull - start from latest main
2. git checkout -b hotfix/critical-fix - create hotfix branch
3. Fix the issue, add tests
4. git commit -m "Fix: critical bug description"
5. git push -u origin hotfix/critical-fix
6. Merge to main via PR, then git tag v1.0.1
7. git checkout develop && git merge hotfix/critical-fix - backport
Release Workflow
1. git checkout -b release/v2.0 from develop
2. Bump version, update changelog
3. git commit -m "Prepare release v2.0"
4. Test and fix bugs on the release branch
5. git checkout main && git merge release/v2.0
6. git tag -a v2.0 -m "Release v2.0"
7. git push origin main --tags
8. git checkout develop && git merge release/v2.0 - sync back