chore: add files from master-wiki repo
This commit is contained in:
parent
f99a9ae2ac
commit
1847f6bf28
315 changed files with 1047341 additions and 0 deletions
29
_master_wiki/notes/Git.md
Normal file
29
_master_wiki/notes/Git.md
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
created: 2024-02-20 12:23
|
||||
updated: 2024-03-12 13:49
|
||||
---
|
||||
## 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