Feature branch workflow
A feature branch workflow keeps shared branches stable while allowing developers to work independently.
Standard sequence
git switch main
git pull
git switch -c short-descriptive-branch
# edit files
git status
git diff
git add -p
git commit -m "Describe the focused change"
git push -u origin short-descriptive-branchOpen a pull request after pushing. Keep commits focused, respond to review with additional commits, and update the branch if main moves.
Branch naming
Good names describe intent: fix-payment-webhook-idempotency, add-git-course-payload, or improve-dashboard-empty-state. Avoid vague names such as changes or anup-work.
Merge policy
Teams may use merge commits, squash merges, or rebase merges. Follow the repository convention. Consistency matters more than personal preference.