Metainformationen zur Seite
  •  

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
anleitung:programmieren:git_grundlagen [07.02.2019 12:57] – [Übersicht] J. Huberanleitung:programmieren:git_grundlagen [10.07.2025 15:36] (aktuell) – [Allgemeines] J. Huber
Zeile 1: Zeile 1:
-<hidden Artikel Info> 
----- dataentry ArtikelInfo ---- 
-Name                          : Git Grundlagen #  
-Beschreibung                  : Git Grundlagen #  
-ProjektNr                     :  
-Bereich_tagmain               : anleitung #  
-Kategorien_taganleitungs      : programmieren #  
-Webkategorie_taganleitung_web :  #  
-Technologie_prjtechs          :  #  
-Sprache_tagprogramming        :  #  
-Version                       : 2019-01-15 #  
----- 
- 
- 
-</hidden> 
- 
 ====== Git Grundlagen ====== ====== Git Grundlagen ======
  
Zeile 28: Zeile 12:
 | git log\\ gitk                                                              | Commit Historie anzeigen                                                                                               | | git log\\ gitk                                                              | Commit Historie anzeigen                                                                                               |
 | git tag [-a] <tag> [-m '<beschreibung>'                                   | Neuen Tag anlegen                                                                                            |           | | git tag [-a] <tag> [-m '<beschreibung>'                                   | Neuen Tag anlegen                                                                                            |           |
 +| git branch <feature1>\\ git checkout <feature1>                             | Mit ''branch'' wird der Branch erstellt.\\ Mit ''checkout'' wird zum Branch gewechselt.                      |           |
 +
 +
 +==== Allgemeines ====
 +
 +=== Benutzer und Passwort ===
 +
 +<code bash>
 +$ git remote set-url origin https://name@github.com/repo.git
 +</code>
 +
 +<code bash>
 +$ git remote set-url origin https://name:password@github.com/repo.git
 +</code>
 +
 +
 +=== Repository auschecken ===
 +<code bash>
 +$ git clone /pfad/zum/repository
 +$ git clone benutzername@host:/pfad/zum/repository
 +$ git -c http.sslVerify=false clone <repository-name>
 +</code>
 +
 +
 +=== Repository update vom Parent ===
 +<code bash>
 +git fetch
 +git rebase origin/master
 +</code>
 +
 +
 +=== clone subdirectory ===
 +
 +<code bash>
 +$ git clone src_project/ dest_project/
 +$ cd dest_project
 +$ git filter-branch --prune-empty --subdirectory-filter clone_directory HEAD
 +</code>
 +
  
  
 ==== Submodule ==== ==== Submodule ====
 +
 +=== Add a submodule ===
 +
 +<code bash>
 +$ cd <project>
 +$ git submodule add https://git.evenhausen.de/<submodule>.git <submodule_dir>
 +$ git submodule init
 +</code>
 +
  
 === Commit and push submodule changes === === Commit and push submodule changes ===
  
 <code bash> <code bash>
-cd project/path/to/submodule+cd <project/submodule_dir>
 $ git add <stuff> $ git add <stuff>
 $ git commit -m "comment" $ git commit -m "comment"
Zeile 44: Zeile 76:
  
 <code bash> <code bash>
-$ cd  project +$ cd  <project> 
-$ git add path/to/submodule+$ git add <submodule_dir>
 $ git commit -m "updated my submodule" $ git commit -m "updated my submodule"
 $ git push $ git push
Zeile 53: Zeile 85:
  
 <code bash> <code bash>
 +$ cd <submodule_dir>
 $ git checkout master  # checkout desired branch $ git checkout master  # checkout desired branch
 $ git pull             # update content $ git pull             # update content
- 
 </code> </code>
 +
 +=== Disable SSL verification for a specific repository ===
 +
 +<code bash>
 +$ git config --global http.sslVerify false
 +</code>
 +=== Nur Unterverzeichnis ===
 +
 +<code bash>
 +$ git clone --no-checkout --depth 1 --sparse --filter=blob:none https://git.evenhausen.de/$ORG/$REPO.git
 +$ cd $REPO
 +$ git sparse-checkout init --cone
 +$ git sparse-checkout add relevant/dir/
 +$ git checkout master
 +</code>
 +
 +==== Links ====
 +  * [[https://git-scm.com/docs| Git Reference ]]
 +  * [[https://git-scm.com/book/de/v2| Git Book ]]
 +  * [[https://rogerdudler.github.io/git-guide/index.de.html|Der einfache Einstieg]]
  
  
 {{tag>programmieren  }} {{tag>programmieren  }}
 +
 ---- struct data ---- ---- struct data ----
 +artikelinfo.name     : Git Grundlagen
 +artikelinfo.beschreibung : Git Grundlagen
 +artikelinfo.status   : Fertig
 +artikelinfo.statuslink : Fertig|Fertig
 +artikelinfo.version  : 2023-04-15
 +artikelinfo.cats     : Anleitung, Entwicklung, Grundlagen, Linux, Programmieren, Windows
 +artikelinfo.catlinks : Anleitung|Anleitung, Entwicklung|Entwicklung, Grundlagen|Grundlagen, Linux|Linux, Programmieren|Programmieren, Windows|Windows
 +artikelinfo.prg      : 
 ---- ----