Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
|
wiki2:gitcommands [2020/01/28 07:04] alfred [Merges] |
wiki2:gitcommands [2020/06/16 12:26] (actual) |
||
|---|---|---|---|
| Línea 85: | Línea 85: | ||
| <code> | <code> | ||
| git reset HEAD~ | git reset HEAD~ | ||
| + | </code> | ||
| + | |||
| + | ==== Unstage changes ==== | ||
| + | <code> | ||
| + | git rm --cached -r -- . | ||
| + | </code> | ||
| + | |||
| + | ===== Reset ===== | ||
| + | ==== Reset a full repo ==== | ||
| + | <code> | ||
| + | git reset --hard HEAD | ||
| + | git clean -f -d | ||
| + | </code> | ||
| + | |||
| + | ==== Reset a single file ==== | ||
| + | <code> | ||
| + | git checkout filename | ||
| + | </code> | ||
| + | |||
| + | ==== Reset a file with the same name as a branch ==== | ||
| + | |||
| + | <code> | ||
| + | git checkout -- filename | ||
| + | </code> | ||
| + | |||
| + | ==== Remove not tracket files ==== | ||
| + | <code> | ||
| + | git clean -f -d | ||
| </code> | </code> | ||
| ===== Branches ===== | ===== Branches ===== | ||
| Línea 99: | Línea 127: | ||
| </code> | </code> | ||
| - | ==== Eliminar branch local ==== | + | ==== Eliminar branch ==== |
| + | === Local === | ||
| <code> | <code> | ||
| git branch -D no_queues | git branch -D no_queues | ||
| + | </code> | ||
| + | |||
| + | === Remota === | ||
| + | |||
| + | <code> | ||
| + | git push origin --delete test | ||
| </code> | </code> | ||
| Línea 131: | Línea 166: | ||
| Upload tags to the remote: ''git push origin --tags '' | Upload tags to the remote: ''git push origin --tags '' | ||
| + | |||
| + | Remove a tag: | ||
| + | <code> | ||
| + | git push --delete origin <tagname> | ||
| + | </code> | ||
| ===== Push over a non-bare repo ===== | ===== Push over a non-bare repo ===== | ||
| You need to set denyCurrentBranch | You need to set denyCurrentBranch | ||
| Línea 218: | Línea 258: | ||
| </code> | </code> | ||
| + | Other easier: | ||
| + | <code> | ||
| + | git remote add gitea https://git.alfredgg.dev/gtd/docker-without-pants.git | ||
| + | git push gitea | ||
| + | </code> | ||
| ==== Use git from another folder ==== | ==== Use git from another folder ==== | ||
| <code> | <code> | ||