Git in Production
March 27, 2019
Hilfreiche Aliases
In ~/.gitconfig:
code
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --branches
Amend (nur unpushed)
code
git commit --amend
Feature mit main updaten
code
git switch main
git pull
git switch feature
git merge main
Rebase nur, wenn noch nichts gepusht wurde.
Stash
code
git stash
git stash pop
git stash list
Diff
code
git diff
git diff --staged
git diff HEAD
Revert (sicher fuer remote)
code
git revert <commit>
Reset (nur lokal, destruktiv)
code
git reset --hard <commit>