Git Branching and Tags Guide

git branching tags reference


Timeline Example: Branches and Tags Working Together

# Start of project
main → commit A [tag: v1.0.0]
 
# Developer 1 works on feature
git checkout -b feature/panorama-rule-tester
main → commit A [tag: v1.0.0]
feature/panorama-rule-tester → commit A → commit B → commit C
 
# Developer 2 works on bug fix (at same time)
git checkout -b bugfix/session-timeout
main → commit A [tag: v1.0.0]
bugfix/session-timeout → commit A → commit D → commit E
 
# Feature is done, merge to main
git checkout main
git merge feature/panorama-rule-tester
main → commit A [tag: v1.0.0] → commit B → commit C
 
# Bug fix is done, merge to main
git merge bugfix/session-timeout
main → commit A [v1.0.0] → commit B → commit C → commit D → commit E
 
# Ready to release? Update version files and tag
echo "1.1.0" > VERSION
git add VERSION VERSIONS.md CHANGELOG.md
git commit -m "Bump version to 1.1.0"
git tag v1.1.0 -m "Release v1.1.0"
 
main → commit A [v1.0.0] → ... → commit F [v1.1.0]
 
# Delete old feature branches (no longer needed)
git branch -d feature/panorama-rule-tester
git branch -d bugfix/session-timeout
 
# Both branches are gone, but their commits are in main
# The tags v1.0.0 and v1.1.0 permanently mark those releases

Common Mistakes to Avoid

# WRONG - Don't use version numbers as branch names
git checkout -b v1.1.0
git checkout -b v1.0.1-fixes
git checkout -b release-1.2.0
 
# WRONG - Too vague
git checkout -b fixes
git checkout -b updates
git checkout -b changes
git checkout -b michael-branch
 
# WRONG - No context
git checkout -b temp
git checkout -b test
git checkout -b new

Adding New Tools/Features

feature/add-checkpoint-tool
feature/add-fortinet-support
feature/panorama-rule-tester

Improving Existing Features

enhancement/improve-fmc-decom-performance
enhancement/add-excel-export-zone-lookup
enhancement/better-error-messages

Fixing Bugs

bugfix/fix-panorama-authentication
bugfix/fix-infoblox-special-characters
bugfix/session-cookie-size

Documentation

docs/update-deployment-guide
docs/add-tool-examples
docs/improve-readme

Security

security/update-dependencies
security/fix-credential-logging
security/add-input-validation

Cleanup/Refactoring

refactor/consolidate-panorama-api-calls
chore/update-python-dependencies
cleanup/remove-unused-code

Summary

TypePurposeExamples
BranchesDescribe the WORK you’re doingfeature/what-im-building, bugfix/what-im-fixing
TagsMark RELEASESv1.0.0, v1.0.1, v1.1.0

Key insight: You never know what version number something will become until you’re ready to release. That’s why you describe the WORK (feature/add-ipv6) instead of the VERSION (v1.2.0).