# Editor für commit-msg ändern:
git config --global core.editor "vim"
git config --global user.name [myusername]
git config --global user.name [[email protected] ]
# Rename Detection als Default einstellen:
git config --global diff.renames true
git clone pr3d@ubunas:~/my_scripts
# Start new Repo on my server:
git init --bare foldername.git
git clone <url> --branch <branch> --single-branch [<folder>]
git checkout [brachname]
Log mit Dateiänderungen anzeigen:
git log -p
git log --oneline
git log --stat
verschoben und kopiert mit anzeigen:
nur die letzten 5 Einträge anzeigen
git log -5
# just a list all repo CONTRIBUTORS:
git log --format='%aN <%aE>' | sort -u
git status --short
alle geänderten und hinzugefügten Dateien vom aktuellen VZ und unter-VZs zum staging hinzufügen
diff von gestagten files anzeigen.
git diff --staged [<file>]
direktes commit ohne staging
git commit --all
git commit file1.txt file2.txt
letzten commit wieder rückgängig machen aber die Datei-Änderungen behalten
Alle Änderungen am Workspace in Zwischenspeicher übernehmen
git stash --include-untracked
letzten Änderungen zurückholen
Change remote from https to SSH (to allow push via ssh public key)
git remote set-url origin [email protected] :<USERNAME>/<REPONAME>.git
git remote add [name] file:///User/name/path/repo.git
Zeige konfigurierte Remotes an (push/fetch)
git remote --verbose
git remote show [name]
Zeige Verknüpfungen von lokalen branches zu Upstream-Branches an
Neuen Branch anlegen und auschecken
git checkout -b [newBranch]
git checkout -b [FeatureBranch] [SourceBranch]
git checkout -b feature/TicketNr develop