#+title: Git Workflow #+date: [2023-12-05 Tue] #+filetags: :tools:git: #+identifier: 20231205T090000 * Branching Strategy ** Main Branch Always deployable. Only merge through pull requests. ** Feature Branches - Name: =feature/short-description= - Short-lived: merge within days, not weeks - One concern per branch * Commit Messages Follow the conventional commits spec: #+begin_example (): [optional body] [optional footer] #+end_example Types: =feat=, =fix=, =docs=, =style=, =refactor=, =test=, =chore= * Useful Aliases #+begin_src gitconfig [alias] lg = log --oneline --graph --decorate --all st = status -sb co = checkout undo = reset --soft HEAD~1 #+end_src * Rebase vs Merge - *Rebase*: clean linear history, good for feature branches before merging - *Merge*: preserves history, good for long-lived branches