Benutzer-Werkzeuge

Webseiten-Werkzeuge


tools:git

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
tools:git [2021/02/06 14:46] – [Tags] admintools:git [2023/11/14 18:06] (aktuell) – Git-Dokumentation admin
Zeile 1: Zeile 1:
 ====== git ====== ====== git ======
 +
 +===== Dokumentation =====
 +
 +  * [[https://git-scm.com/docs|Offizielle Git-Referenz]]
 +  * [[https://jvns.ca/blog/2023/11/01/confusing-git-terminology/|Julia Evans: Confusing git terminology]]
  
 ===== Website Deployment mit Git ===== ===== Website Deployment mit Git =====
Zeile 7: Zeile 12:
 ---- ----
  
-===== Befehle ===== +===== Commits =====
- +
-==== Tags ==== +
- +
-=== Tags auflisten === +
- +
-<code> +
-# Alle lokalen Tags auflisten: +
-git tag +
- +
-# Tags von Remote auflisten: +
-git ls-remote --tags origin +
- +
-# Tags +
-git tag -l "9.5*" +
-</code> +
- +
-=== Annotierte Tags erstellen === +
- +
-<code> +
-git tag -a 10.4.1 -m "[RELEASE] Release of version 10.4.1" +
-git tag -a 9.5.1 -m "[RELEASE] Release of version 9.5.1" +
-git tag -a 8.7.1 -m "[RELEASE] Release of version 8.7.1" +
-</code> +
- +
-=== Tags in Repository pushen === +
- +
-<code> +
-# Einzelnen Tag pushen. Schema: git push origin <tagname> +
-git push origin 10.4.1 +
- +
-# Alle Tags pushen, die noch nicht remote vorliegen: +
-git push origin --tags +
-</code>+
  
 ==== Letzten commit ändern ==== ==== Letzten commit ändern ====
Zeile 92: Zeile 64:
 git merge tempfix git merge tempfix
 </code> </code>
 +
 ==== Datei aus Index entfernen, ohne sie zu löschen ==== ==== Datei aus Index entfernen, ohne sie zu löschen ====
  
Zeile 98: Zeile 71:
 <code> <code>
 git rm --cached example.txt  git rm --cached example.txt 
 +</code>
 +
 +----
 +
 +===== Tags =====
 +
 +==== Tags auflisten ====
 +
 +<code>
 +# Alle lokalen Tags auflisten:
 +git tag
 +
 +# Tags von Remote auflisten:
 +git ls-remote --tags origin
 +
 +# Tags
 +git tag -l "9.5*"
 +</code>
 +
 +==== Annotierte Tags erstellen ====
 +
 +<code>
 +git tag -a 10.4.1 -m "[RELEASE] Release of version 10.4.1"
 +git tag -a 9.5.1 -m "[RELEASE] Release of version 9.5.1"
 +git tag -a 8.7.1 -m "[RELEASE] Release of version 8.7.1"
 +</code>
 +
 +==== Tags in Repository pushen ====
 +
 +<code>
 +# Einzelnen Tag pushen. Schema: git push origin <tagname>
 +git push origin 10.4.1
 +
 +# Alle Tags pushen, die noch nicht remote vorliegen:
 +git push origin --tags
 +
 +# Pushen von Commits sowie zugänglicher Tags (= keine Tags aus nicht vorliegenden Branches):
 +git push --follow-tags
 +</code>
 +
 +----
 +
 +===== cherry-pick =====
 +
 +==== Änderungen in Branch laden, ohne zu committen ====
 +
 +Mit dem ''-n'' Flag können wir Commits in einen anderen Branch laden, ohne dass dort ein neuer Commit durchgeführt wird. Die Änderungen werden stattdessen auf den Working Tree und den Index angewendet.
 +
 +<code>
 +git cherry-pick -n acf12f33
 +</code>
 +
 +----
 +===== Branches =====
 +
 +==== Aktuellen Branch mit Remote-Branch verknüpfen ====
 +
 +<code>
 +git branch --set-upstream-to origin/branchname
 +</code>
 +
 +----
 +
 +===== .gitignore =====
 +
 +==== Dateien und Ordner global ignorieren ====
 +
 +<code>
 +# 1. Neue Datei im User-Verzeichnis anlegen:
 +touch ~/.gitignore_global
 +
 +# 2. Datei als globale Variable konfigurieren:
 +git config --global core.excludesfile ~/.gitignore_global
 +
 +# 3. Zu ignorierende Patterns in der Datei ergänzen:
 +nano ~/.gitignore_global
 </code> </code>
  
tools/git.1612619184.txt.gz · Zuletzt geändert: 2021/02/06 14:46 von admin