Skip to content

Instantly share code, notes, and snippets.

@janisozaur
Created September 7, 2024 09:29
Show Gist options
  • Save janisozaur/dc27d1904ddbd664678b99d8dc8bb1a5 to your computer and use it in GitHub Desktop.
Save janisozaur/dc27d1904ddbd664678b99d8dc8bb1a5 to your computer and use it in GitHub Desktop.
git aliases
[alias]
lol = log --graph --decorate --pretty=oneline --abbrev-commit \
--pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) \
%C(bold blue)<%an>%Creset'
loll = log --graph --decorate --pretty=oneline --abbrev-commit \
--pretty=tformat:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) \
%C(bold blue)<%an>%Creset' --numstat
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all \
--pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) \
%C(bold blue)<%an>%Creset'
sc = svn dcommit --interactive
cp = cherry-pick
st = status
co = checkout
ci = commit
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
fl = log -u
dl = "!git ll -1"
dc = diff --cached
f = "!git ls-files | grep"
la = "!git config -l | grep alias | cut -c 7-"
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
assumeall = "!git st -s | awk {'print $2'} | xargs git assume"
cl = clone
br = branch
top = rev-parse --show-toplevel
ct = "!cd $(git top)"
dsf = "!f() { [ \"$GIT_PREFIX\" != \"\" ] && cd "$GIT_PREFIX"; git diff --color $@ | diff-so-fancy | less --tabs=4 -RFX; }; f"
diff-words = diff --color-words='[^[:space:]]|([[:alnum:]]|UTF_8_GUARD)+'
[color "diff-highlight"]
oldNormal = --get
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment