Git Kommandos

Aus Laemmi´s Wiki
Zur Navigation springen Zur Suche springen

Aktuellen master ziehen

git checkout master
git pull origin master

Neuen branch anlegen

git branch BRANCHNAME origin/master
git checkout -b BRANCHNAME origin/master

In branch wechseln

git checkout BRANCHNAME

Branch zusammenführen

git merge origin/master

Branch löschen

git branch -d BRANCHNAME

Update mit Änderungen

git stash
git pull origin
git stash apply

Änderungen rückgängig

git checkout -- PATH_FILE

Git Repository aufräumen

git fsck 
git gc
time git status

Pushen mit anden remotebranch

git push origin localbranch:remotebranch

Remote liste

git remote -v

Remote url ändern

git remote rm origin
git remote add origin git@SERVER/NAME.git

Rest

git reset --hard 6f700f0

Cherry pick

git cherry-pick 1234567

Branch umbenennen

git branch -m <oldname> <newname>

Delete tag

If you set tag e.g in github release

git fetch
git tag -d <tagname>
git push origin :refs/tags/<tagname>

Prune remote branches

git remote prune origin