daily git - gluehloch/java-examples GitHub Wiki

  • Listet alle Tags und zeigt das Erstellungsdatum mit an.
    git log --tags --simplify-by-decoration --pretty="format:%ai %d"
    

TODO: Kopiert aus ZSH GIT-Plugn.

gst='git status'

Git Alias für Bash-like Shells:

gke='\gitk --all $(git log -g --pretty=%h)'
glg='git log --stat'
glgg='git log --graph'
glgga='git log --graph --decorate --all'
glgm='git log --graph --max-count=10'
glgp='git log --stat -p'
glo='git log --oneline --decorate'
glod='git log --graph --pretty='\''%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset'\'
glods='git log --graph --pretty='\''%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset'\'' --date=short'
glog='git log --oneline --decorate --graph'
gloga='git log --oneline --decorate --graph --all'
glol='git log --graph --pretty='\''%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'
glola='git log --graph --pretty='\''%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --all'
glols='git log --graph --pretty='\''%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --stat'
gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
glb="git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'""

Git Alias

git config --global alias.glg 'log --graph --oneline --decorate'
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

Test: git lg oder git lg -p

Git stash

git stash save "Nachricht"

Stashen inklusive aller 'untracked' Dateien:

git stash save -u "Nachricht" 

Git checkout

Auschecken eines Tags auf einen neuen Branch:

git checkout tags/<tag> -b <branch>

Auschecken einer Commit-ID auf einen neuen Branch:

git checkout -b NEW_BRANCH_NAME COMMIT_ID

Git add and remove a file from the staging area

git add <filename>
git reset <filename>
⚠️ **GitHub.com Fallback** ⚠️