Git: Unterschied zwischen den Versionen

Aus Nicki Wiki
Zur Navigation springen Zur Suche springen
Zeile 21: Zeile 21:


== Submodule ==
== Submodule ==
  git submodule add -b master <pfad>
  git submodule add -b master <Repo-Pfad>
  git submodule init
  git submodule init
  git submodule update
  git submodule update

Version vom 31. August 2021, 07:55 Uhr

Häufige Befehle

Clone

git clone <Repo-Pfad>
git clone --branch <Branch-Name> <Repo-Pfad>
git clone --recurse-submodules <Repo-Pfad>
git clone --branch <Branch-Name> --recurse-submodules <Repo-Pfad>

Branch

git checkout <Branch-Name>  #branch auschecken
git checkout -b iss53       #Neuen branch anlegen und auschecken

git checkout -- <Datei>     #Änderung verwerfen

Stage/Commit

git add .                   #Stagen
git reset HEAD <Datei>      #Staging verwerfen
git commit -m "commit Text"
git reset --soft HEAD^      #Commit Rückgängig machen
git reset --hard HEAD^      #Commit verwerfen

Submodule

git submodule add -b master <Repo-Pfad>
git submodule init
git submodule update