A quick reference for our Feature Branch Workflow & Conventional Commits.
π 1. Starting Work (New Feature)
Start a new feature from dev (Staging):
# 1. Switch to dev and get latest
git checkout dev
git pull origin dev
# 2. Create your branch
git checkout -b feat/my-new-featureπΎ 2. Saving Work (Committing)
Stage and Commit:
# 1. Stage all changes
git add .
# 2. Commit (Follow Conventional Commits!)
git commit -m "feat(auth): add google login provider"Common Commit Types:
feat: ...(New feature)fix: ...(Bug fix)refactor: ...(Code cleanup)chore: ...(Config/Deps)docs: ...(Documentation)
π 3. Syncing & Sharing
Push your branch for the first time:
git push -u origin feat/my-new-featureUpdate your branch with latest changes from dev:
git fetch origin
git merge origin/dev
# If conflicts: Fix files, then `git add .` and `git commit`π οΈ 4. Advanced / "Oh $#!%" Commands
Undo last commit (Keep changes in staged area):
git reset --soft HEAD~1Unstage a file (Remove from git add):
git restore --staged filename.tsDiscard all local changes (DANGER β οΈ):
git restore .Change last commit message:
git commit --amend -m "feat: corrected message"π§Ή 5. Cleanup
Delete branch locally (after merge):
git branch -d feat/my-new-featureDelete branch remotely:
git push origin --delete feat/my-new-feature