Git Workflow for Solo Devs
Mange git guides antager du arbejder i et team. Men hvad hvis du er alene? Her er hvad der virker for mig.
Branch Strategy
Jeg bruger en simpel model:
main- altid deploybardev- dagligt arbejdefeature/*- større features
# Start ny feature
git checkout -b feature/new-thing dev
# Færdig? Merge tilbage
git checkout dev
git merge --no-ff feature/new-thing
git branch -d feature/new-thing
Commit Messages
Brug conventional commits - det gør changelog automatisk:
feat: add user authentication
fix: resolve memory leak in cache
docs: update API documentation
refactor: simplify database queries
Aliaser der sparer tid
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.st status
git config --global alias.lg "log --oneline --graph --all"
Stash er din ven
# Gem nuværende arbejde
git stash push -m "WIP: login form"
# Se alle stashes
git stash list
# Hent tilbage
git stash pop
Keep it simple!