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/03/18 09:53] alfred |
wiki2:gitcommands [2020/06/16 12:26] (actual) |
||
|---|---|---|---|
| Línea 92: | Línea 92: | ||
| </code> | </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> | ||
| ===== Branches ===== | ===== Branches ===== | ||
| * Create new branch: ''git checkout -b [name_of_your_new_branch]'' | * Create new branch: ''git checkout -b [name_of_your_new_branch]'' | ||
| Línea 236: | 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> | ||