Git development flow
Git development flow
Use Git Conventional Commits
- Create branch
git switch -c feat/uvc-monitor-logic
# ot
git branch feat/uvc-monitor-logic && git switch feat/uvc-monitor-logic
- Work, add, commit (small commits, Conventional Commits)
- Push your branch to GitHub
-
Open Pull Request in GitHub.
-
Use a clear Conventional Commit PR tittle
-
Push more commits as needed
-
Merge Pull Request
- Use yout team's choice (Merge commits/Squash)
- Click Delete branch in GitHub
-
Clean up locally and prune stale remotes
- Sync your local
mainbranch (fast-forward only)
Bring changes from main into a feature branch
When working on a feature branch, you often need to update it with the latest changes from main.
The recommended approach is:
git switch feat/branch
git fetch origin main
git merge origin/main
# resolve conflicts if any, then commit