Skip to content

Git development flow

Git development flow

Use Git Conventional Commits

  1. Create branch
git switch -c feat/uvc-monitor-logic
# ot
git branch feat/uvc-monitor-logic && git switch feat/uvc-monitor-logic
  1. Work, add, commit (small commits, Conventional Commits)
git add monitor.sv
git commit -m "feat: add monitor logic"
  1. Push your branch to GitHub
git push -u origin feat/uvm-monitor-logic
  1. Open Pull Request in GitHub.

  2. Use a clear Conventional Commit PR tittle

  3. Push more commits as needed

  4. Merge Pull Request

    • Use yout team's choice (Merge commits/Squash)
    • Click Delete branch in GitHub
  5. Clean up locally and prune stale remotes

git switch main
git fetch --prune origin
git branch -D feat/uvm-monitor-logic
  1. Sync your local main branch (fast-forward only)
git pull --ff-only origin main

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

Reference Material

Git