The most common approach: every new feature or fix gets its own branch.
git switch -c feature/user-auth # descriptive branch name
# ... develop ...
git push -u origin feature/user-auth
# Open a Pull Request / Merge Request on GitHub/GitLab
# Get code review
git switch main && git pull # get merged changes
Structured commit messages help automation (changelogs, semantic versioning):
feat: add user authentication
fix: correct email validation regex
docs: update API reference
refactor: extract auth into separate module
test: add unit tests for login flow
chore: upgrade dependencies
git log --onelineSimulate the full feature branch workflow: create a branch feature/greeting, add greeting.txt, commit with a conventional commit message starting with feat:, then merge back to main and delete the feature branch.
Click "Run" to execute your code.