GIT

Aus wiki
Wechseln zu: Navigation, Suche

Commands

Delete all remotely deleted files

git rm $(git ls-files --deleted)

View File 2 Commits before

git show HEAD~2:public/app/styles/main.css

Search File in Log

git log --diff-filter=D --summary | grep filename | awk '{print $4; exit}' | xargs git log --all --

Nice Git log

git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
src: https://coderwall.com/p/euwpig/a-better-git-log

As git alias command:

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"
just use git lg

Set new remote url for git repo:

git remote set-url origin git@github.com:ChristofBuechi/RetrofitExample.git