Skip to main content

Git configuration

·302 words·2 mins
Themes Guide - This article is part of a series.
Part : This Article

Git configuration

Overview #

start here, this page is under construction!

alias.ls=log --pretty=format:"%C(yellow)%h %cd%Cblue [%cn] %Cred%d - %Creset%s" --decorate --date=format:"%Y-%m-%d %H:%M:%S"
alias.cmp=!f() { git add -A && git commit -m "$@" && git push && git lg; }; f
alias.lg=log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' --all
alias.st=status
alias.rh=!f() { git reset --hard $@ && git lg; }; f
alias.rs=!f() { git reset --soft $@ && git lg; }; f
alias.rmix=!f() { git reset --mixed $@ && git lg; }; f
alias.f=!f() { git fetch --all && git lg $@; }; f
alias.p=!f() { git pull --all && git lg $@; }; f
alias.s=!f() { git show --name-status $@; }; f
alias.mnff=!f() { git merge --no-ff $@; }; f
alias.m=!f() { git merge $@; }; f
alias.d1=!f() { git diff $@~ $@; }; f
alias.d2=!f() { git diff $1 $2; }; f
alias.dt1=!f() { git difftool --dir-diff $@~ $@; }; f
alias.dt2=!f() { git difftool --dir-diff $1 $2; }; f
alias.dt=!f() { git difftool; }; f
alias.co=!f() { git checkout $@ && git lg; } ; f
alias.cor=!f() { git checkout --track $@ && git lg; } ; f
alias.cb=!f() { git branch $@ && git push origin $@ && git checkout $@ && git lg;} ; f
alias.rb=!f() { git branch -d $@ && git push origin --delete $@ && git lg;} ; f
alias.ct=!f() { git tag $1 $2 && git push origin --tags && git lg;} ; f
alias.rt=!f() { git tag --delete $@ && git push origin :refs/tags/$@ && git lg;} ; f
alias.sw=!zsh -c /Users/yexinchen/code/projects/home/git_sw.zsh
alias.slr=show-ref
alias.sr=remote show origin

Diff and Merge Tool using Beyond Compare

diff.tool=bcomp
difftool.prompt=false
difftool.bcomp.trustexitcode=true
difftool.bcomp.cmd="C:\Program Files\Beyond Compare 4\BComp.exe" "$LOCAL" "$REMOTE"
merge.tool=bcomp
mergetool.prompt=false
mergetool.bcomp.trustexitcode=true
mergetool.bcomp.cmd="C:\Program Files\Beyond Compare 4\BComp.exe" "$LOCAL" "$REMOTE" "$BASE" "$MERGED"

Test #

Test2 #

test

Themes Guide - This article is part of a series.
Part : This Article