programmieren_lernen:git_and_2_3_8_6_8_and_hg0w_hg0w
no way to compare when less than two revisions
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| — | programmieren_lernen:git_and_2_3_8_6_8_and_hg0w_hg0w [2023/12/27 12:37] (aktuell) – [Dateien auf rechner1 bearbeiten] 91.240.118.241 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | ===== Repository erzeugen ===== | ||
| + | ssh rechner1 | ||
| + | cd / | ||
| + | git init | ||
| + | git add . | ||
| + | git commit -a | ||
| + | |||
| + | ===== Repository importieren ===== | ||
| + | ssh rechner2 | ||
| + | git clone ssh:// | ||
| + | git remote add rechner1 ssh:// | ||
| + | |||
| + | |||
| + | |||
| + | ===== Dateien auf rechner1 bearbeiten ===== | ||
| + | ssh rechner1 | ||
| + | |||
| + | ==== Änderungen betrachten ==== | ||
| + | git status | ||
| + | git diff --cached | ||
| + | | ||
| + | ==== Änderungen im Repository speichern ==== | ||
| + | git commit -a | ||
| + | | ||
| + | |||
| + | ===== Änderungen auf rechner2 mergen ===== | ||
| + | ==== Alles übertragen und mergen ==== | ||
| + | ssh rechner2 | ||
| + | git pull | ||
| + | |||
| + | ==== Übertragen, | ||
| + | git fetch | ||
| + | git log -p HEAD..origin | ||
| + | git merge origin | ||
| + | |||
| + | ==== Einzelne Patches mergen ==== | ||
| + | statt '' | ||
| + | git cherry-pick ac1a88a5c235055a41d961e898dfb8c0d3e17f72 | ||
| + | |||
| + | ====== How to fix mistakes ====== | ||
| + | Haven' | ||
| + | git reset --hard | ||
| + | You can also do it for individual files, but it's a bit different: | ||
| + | git checkout myfile.txt | ||
| + | Messed up the commit message? This will let you re-enter it: | ||
| + | git commit --amend | ||
| + | Forgot something in your last commit? That's easy to fix. | ||
| + | git reset --soft HEAD^ | ||
| + | Add that stuff you forgot: | ||
| + | git add forgot.txt these.txt | ||
| + | Then write over the last commit: | ||
| + | git commit | ||
| + | |||
| + | |||
| + | ====== Dokumentation ====== | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * http:// | ||
programmieren_lernen/git_and_2_3_8_6_8_and_hg0w_hg0w.txt · Zuletzt geändert: 2023/12/27 12:37 von 91.240.118.241
