Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung Nächste ÜberarbeitungBeide Seiten der Revision | ||
git_gitea [01/10/2022 - 10:26] – gelöscht - Externe Bearbeitung (Unknown date) 127.0.0.1 | git_gitea [03/10/2022 - 07:19] – thommie4 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== GIT und GITHUB Basisdoku ====== | ||
+ | |||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | ===== GIT ===== | ||
+ | |||
+ | ==== Basisfunktionen & lokale Instanz ==== | ||
+ | |||
+ | - Arbeitskopie = die echten Dateien, dynamisch | ||
+ | - '' | ||
+ | - HEAD zeigt immer auf letzten Commit. Ein '' | ||
+ | |||
+ | Initialisierung: | ||
+ | |||
+ | < | ||
+ | git init | ||
+ | git add . | ||
+ | </ | ||
+ | |||
+ | Danach initialer Commit, um den aktuellen Stand im HEAD aufzunehmen | ||
+ | |||
+ | '' | ||
+ | |||
+ | |||
+ | ==== Remote Repos: Verknüpfen einer lokalen Instanz mit Github ==== | ||
+ | |||
+ | **Kontrolle der Remote Ziele " | ||
+ | |||
+ | < | ||
+ | git remote -v | ||
+ | |||
+ | origin | ||
+ | origin | ||
+ | upstream | ||
+ | upstream | ||
+ | </ | ||
+ | |||
+ | Nach dem Anlegen eines eigenen Repos auf github kann man das lokale Repo mit einem Repo auf github verknüpfen. | ||
+ | |||
+ | * origin = persönliches git Repo auf Github. Die kann ein privater Fork eines öffentlichen Repos auf github sein. | ||
+ | |||
+ | Anders bei öffentlichen Repos: Öffentliche Repos werden zunächst geforkt, also eine Kopie im eigenen Repo-Speicher als " | ||
+ | |||
+ | * upstream = öffentliches Github Repo (z.B. [[https:// | ||
+ | |||
+ | Lokale Instanz: hinzufügen des entfernten " | ||
+ | |||
+ | < | ||
+ | git remote add origin git@github.com: | ||
+ | git push -u origin master | ||
+ | </ | ||
+ | |||
+ | Analog geht das Verbinden des öffentlichen Repos als " | ||
+ | |||
+ | < | ||
+ | git remote add upstream '' | ||
+ | </ | ||
+ | |||
+ | ==== Synchronisation lokales Repo mit entfernten ==== | ||
+ | |||
+ | **pushen** | ||
+ | |||
+ | '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | **abholen** | ||
+ | |||
+ | '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | |||
+ | ===== Github: entferntes Repo klonen ===== | ||
+ | |||
+ | Lokale Kopie des aktuellen Arbeitsstandes auf github anlegen | ||
+ | |||
+ | '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | ====== Update des Fork auf Github ====== | ||
+ | |||
+ | Das geht über das **lokale** | ||
+ | |||
+ | Updates von Upstream holen | ||
+ | |||
+ | < | ||
+ | |||
+ | </ | ||
+ | |||
+ | Zum master bzw. main wechseln | ||
+ | |||
+ | < | ||
+ | |||
+ | </ | ||
+ | |||
+ | Master mit upstream mergen | ||
+ | |||
+ | < | ||
+ | |||
+ | </ | ||
+ | |||
+ | Danach push auf den fork setzen. | ||
+ | |||
+ | ===== Branches ===== | ||
+ | |||
+ | Wo bin ich (aktueller Branch) | ||
+ | |||
+ | < | ||
+ | git show branch | ||
+ | </ | ||
+ | |||
+ | Alle Branches im Repo zeigen | ||
+ | |||
+ | < | ||
+ | git branch -a | ||
+ | |||
+ | main | ||
+ | * master | ||
+ | remotes/ | ||
+ | remotes/ | ||
+ | remotes/ | ||
+ | </ | ||
+ | |||
+ | Zum anderen Branch wechseln | ||
+ | |||
+ | < | ||
+ | git checkout master | ||
+ | </ | ||
+ | |||
+ | Freier Wechsel zu Branch | ||
+ | |||
+ | '' | ||
+ | |||
+ | Lokal erzeugten Branch im remote Repo verfügbar machen | ||
+ | |||
+ | '' | ||
+ | |||
+ | synchronisiert in den Master Branch vom Remote Repo (origin)." | ||
+ | |||
+ | Neuen Branch erstellen und zu diesem wechseln | ||
+ | |||
+ | '' | ||
+ | |||
+ | Branch löschen | ||
+ | |||
+ | '' | ||
+ | |||
+ | Download eines Branch (vmware-host-modules) | ||
+ | |||
+ | '' | ||
+ | |||
+ | danach | ||
+ | |||
+ | '' | ||
+ | |||
+ | |||
+ | ====== update & merge ====== | ||
+ | |||
+ | '' | ||
+ | |||
+ | Holt Änderungen von Remote (fetch) **und führt sie mit dem lokalen Stand zusammen** | ||
+ | |||
+ | '' | ||
+ | |||
+ | ==== Upstream nach fork mergen ==== | ||
+ | |||
+ | Lokales Ziel | ||
+ | |||
+ | < | ||
+ | git checkout //master// | ||
+ | |||
+ | </ | ||
+ | |||
+ | Welche branch von Upstream soll wohin geholt werden? | ||
+ | |||
+ | < | ||
+ | git pull git@github.com: | ||
+ | |||
+ | </ | ||
+ | |||
+ | Danach commit, review und push auf den fork bei Github | ||
+ | |||
+ | ===== Wenn etwas ganz schiefgeht ===== | ||
+ | |||
+ | '' | ||
+ | |||
+ | setzt die lokalen Änderungen auf den letzten HEAD Stand. Änderungen, | ||
+ | |||
+ | Hard Reset = Zurück auf den letzten Stand vom entfernten Repository: | ||
+ | |||
+ | '' | ||
+ | |||
+ | ====== Pull requests ====== | ||
+ | |||
+ | Pull requests let you tell others about changes you've pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch. | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | ====== Basis Konfiguration eines Repos ====== | ||
+ | |||
+ | |< | ||
+ | git config -global user.name [name] | ||
+ | |||
+ | git config -global user.email [email] | ||
+ | |||
+ | git config -global core.editor [editor] | ||
+ | |||
+ | </ | ||
+ | |'' | ||
+ | |'' | ||
+ | |'' | ||
+ | |'' | ||
+ | |'' | ||
+ | |'' | ||
+ | |'' | ||
+ | |'' | ||
+ | |'' | ||
+ | |'' | ||
+ | |'' | ||
+ | | | | | ||
+ | |||
+ | ====== Repo duplizieren ====== | ||
+ | |||
+ | Create a bare clone of the repository. | ||
+ | |||
+ | $ git clone --bare https:// | ||
+ | |||
+ | Mirror-push to the new repository. | ||
+ | |||
+ | $ cd old-repository.git | ||
+ | $ git push --mirror https:// | ||
+ | |||
+ | Remove the temporary local repository you created earlier. | ||
+ | |||
+ | $ cd .. | ||
+ | $ rm -rf old-repository.git | ||
+ | |||
+ | ====== Markdown ====== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | ===== ASCIIDoc ===== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | ==== Admonition ==== | ||
+ | |||
+ | < | ||
+ | |||
+ | Here are the other built-in admonition types: | ||
+ | |||
+ | TIP: Pro tip… | ||
+ | |||
+ | IMPORTANT: Don't forget… | ||
+ | |||
+ | WARNING: Watch out for… | ||
+ | |||
+ | CAUTION: Ensure that… </ | ||
+ | |||
+ | ==== Formatierung ==== | ||
+ | |||
+ | < | ||
+ | |||
+ | italic _constrained_ & __un__constrained | ||
+ | |||
+ | bold italic *_constrained_* & **__un__** | ||
+ | |||
+ | monospace `constrained` & ``un``constrained | ||
+ | |||
+ | monospace bold `*constrained*` & ``**un**``constrained | ||
+ | |||
+ | monospace italic `_constrained_` & ``__un__``constrained | ||
+ | |||
+ | monospace bold italic `*_constrained_*` & ``**__un__**``constrained </ | ||
+ | |||
+ | Document header | ||
+ | |||
+ | < | ||
+ | |||
+ | My document provides… </ | ||
+ | |||
+ | ==== Überschriften ==== | ||
+ | |||
+ | '' | ||
+ | |||
+ | ==== Listen ==== | ||
+ | |||
+ | Unordered, basic[[https:// | ||
+ | |||
+ | < | ||
+ | * Edgar Allen Poe | ||
+ | * Sheri S. Tepper | ||
+ | * Bill Bryson | ||
+ | </ | ||
+ | |||
+ | Unordered, basic (alt)[[https:// | ||
+ | |||
+ | < | ||
+ | - Edgar Allen Poe | ||
+ | - Sheri S. Tepper | ||
+ | - Bill Bryson | ||
+ | </ | ||
+ | |||
+ | Nested Lists: To nest one list within another, indent each item in the sublist by four spaces. You can also nest other elements like paragraphs, blockquotes or code blocks. | ||
+ | |||
+ | |||
+ | ===== Gitea ===== | ||
+ | |||
+ | Git with a cup of tea - A painless self-hosted Git service | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | Upgrade script: / | ||
+ | |||
+ | |||