Update from obsidian - thinkpad
Affected files: .obsidian/plugins/obsidian-omnivore/data.json Read Later/Git Merge vs Rebase vs Squash ¿Qué estrategia debemos elegir-.md Read Later/How Game Reviews Actually Affect You.md Read Later/Let's Get Webby! 🦀 🕸️.md Read Later/Use cases for Rust.md Read Later/What the Rust Book didn't tell you about testing....md Read Later/Why Signals Are Better Than React Hooks.md books/Book/Caballo de troya.md books/Book/En el nombre de la rosa.md notes/coping mechanisms/Good Enough.md notes/utils/Crear una nueva funcionalidad.md notes/utils/Git.md notes/utils/React.md projects/personal-page-notes/List of Games.md projects/quests.md
This commit is contained in:
parent
c3e2778f4e
commit
784703b79b
15 changed files with 160 additions and 55 deletions
25
notes/utils/Git.md
Normal file
25
notes/utils/Git.md
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
## Merge strategies
|
||||
|
||||

|
||||
|
||||
## Buscar cuando un bug se introdujo
|
||||
|
||||
Utilizar `git bisect`
|
||||
|
||||
## Fix messy commits
|
||||
|
||||
Ya que estas opciones sobre escriben el historial de git, solo deben aplicarse en local y no commits publicados a un remote.
|
||||
|
||||
### Last commit
|
||||
|
||||
Si solo necesitamos agregar un cambio pequeño al ultimo commit (typo o correr el formatter), podemos aplicarlo con `git commit --ammend`, se puede sobre escribir el mensaje con `-m`.
|
||||
|
||||
### Mutiple commits
|
||||
|
||||
Se pueden arreglar el historial de commits con un `git rebase -i [since commit or branch]` y utilizar las estratégias de pick, squash, reword y drop.
|
||||
|
||||
En caso de que sepamos que haremos un commit que luego no necesitaremos, podemos hacer:
|
||||
- `git commit --fixup [commit hash]` -> descarta el commit message de este commit y mantiene el del commit de referencia
|
||||
- `git commit --squash [commit hash]` -> git juntará los mensajes de todos los commits a hacer squash y el commit de referencia.
|
||||
|
||||
Finalmente podemos hacer `git rebase -i --autosquash` y git eligirá las opciones necesarias a tomar en vez de tener que hacerlo de manera manual.
|
||||
Loading…
Add table
Add a link
Reference in a new issue