| Befehl | Beschreibung | Beispiel |
|---|---|---|
| git init | Neues lokales Repository erstellen | |
| git clone <url> [<ZielVerzeichnis>] git clone <path> [<ZielVerzeichnis>] | Kopie eines existierenden Git Repositorys anlegen | |
| git submodule add <repository> <path> | In einem Unterverzeichnis eines Git-Repositories eine Referenz auf ein anderes Git-Repositories eingebetten | |
| git add <file> [<file> …] | Dateien zur Versionsverwaltung hinzufügen | |
| git commit -m '<Beschreibung>' git commit –amend | Änderungen in die Arbeitskopie übermitteln bzw. korrigieren | |
| git status | Zustand der Dateien prüfen | |
| git log gitk | Commit Historie anzeigen | |
| 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. |
$ git remote set-url origin https://name@github.com/repo.git
$ git remote set-url origin https://name:password@github.com/repo.git
$ git clone /pfad/zum/repository $ git clone benutzername@host:/pfad/zum/repository $ git -c http.sslVerify=false clone <repository-name>
git fetch git rebase origin/master
$ git clone src_project/ dest_project/ $ cd dest_project $ git filter-branch --prune-empty --subdirectory-filter clone_directory HEAD
$ cd <project> $ git submodule add https://git.evenhausen.de/<submodule>.git <submodule_dir> $ git submodule init
$ cd <project/submodule_dir> $ git add <stuff> $ git commit -m "comment" $ git push
Then tell your main project to track the updated version:
$ cd <project> $ git add <submodule_dir> $ git commit -m "updated my submodule" $ git push
$ cd <submodule_dir> $ git checkout master # checkout desired branch $ git pull # update content
$ git config --global http.sslVerify false
$ 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
| Artikel Info | |
|---|---|
| Beschreibung | Git Grundlagen |
| Stand | Fertig |
| Version | 23.0415 |
| Kategorien | , , , , , |