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 [2019/01/12 13:50] alfred [Avoid git asking for password] |
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 168: | Línea 208: | ||
| In case you've made a mistake while resolving a conflict and realize this only after completing the merge, you can still easily undo it: just roll back to the commit before the merge happened with ''git reset --hard '' and start over again. | In case you've made a mistake while resolving a conflict and realize this only after completing the merge, you can still easily undo it: just roll back to the commit before the merge happened with ''git reset --hard '' and start over again. | ||
| + | |||
| + | ===== Bundle ===== | ||
| + | |||
| + | Create a bundle file: | ||
| + | <code> | ||
| + | git bundle create your_name.bundle --all | ||
| + | </code> | ||
| + | Use it: | ||
| + | <code> | ||
| + | git clone <path_to_bundle_file> | ||
| + | </code> | ||
| ===== Fixing ===== | ===== Fixing ===== | ||
| ==== A detached head ==== | ==== A detached head ==== | ||
| Línea 207: | 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> | ||
| Línea 218: | Línea 274: | ||
| </code> | </code> | ||
| + | <code> | ||
| + | git config credential.helper store | ||
| + | </code> | ||
| ==== Gitlab beginning ==== | ==== Gitlab beginning ==== | ||