Flujo de trabajo de Git para desarrolladores individuales
Muchas guías de git asumen que trabajas en equipo. ¿Pero qué pasa si estás solo? Esto es lo que funciona para mí.
Estrategia de sucursal
Yo uso un modelo simple:
main- siempre desplegabledev- trabajo diariofeature/*- características más grandes
# 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
Confirmar mensajes
Utilice confirmaciones convencionales: el registro de cambios lo hace automáticamente:
feat: add user authentication
fix: resolve memory leak in cache
docs: update API documentation
refactor: simplify database queries
Alias que ahorran tiempo
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 es tu amigo
# Gem nuværende arbejde
git stash push -m "WIP: login form"
# Se alle stashes
git stash list
# Hent tilbage
git stash pop
¡Mantenlo simple!