Skip to content

Instantly share code, notes, and snippets.

@bhuber
Last active November 22, 2022 05:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhuber/3190486 to your computer and use it in GitHub Desktop.
Save bhuber/3190486 to your computer and use it in GitHub Desktop.
My git config, provides some nice shortcuts and features
# If you decide to use this, make sure you change name, email,
# and possibly editor first
# DO NOT COPY THIS SECTION INTO YOUR GITCONFIG
[user]
name = Bennet Huber
email = bennet@compose.ai
#Highlight whitespace in diffs
[color]
ui = true
[color "diff"]
whitespace = red reverse
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
editor = vim
pager = less -FMRiX
excludesfile = ~/.gitignore
#autocrlf = true
#Add aliases to your ~/.gitconfig file:
[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
dc = diff --cached
lg = log -p
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
ls = ls-files
ss = stash save
sp = stash pop
pr = pull --rebase
pub = push --set-upstream origin HEAD
pfoh = push -f origin HEAD
cp = cherry-pick
rh = reset --hard
ua = "!git ss; git pr; git smu; git sp"
sm = submodule
smu = submodule update --init
smur = submodule update --recursive
sms = submodule sync
fa = fetch --all
rb = rebase
rba = rebase --abort
rbc = rebase --continue
rbs = rebase --skip
rbi = rebase -i
# Show files ignored by git:
ign = ls-files -o -i --exclude-standard
[rerere]
enabled = true
[pull]
rebase = true
[init]
defaultBranch = main
[diff "dyff"]
command = "dyff_between() { echo \"$2\" .. \"$5\"; dyff --color on between --omit-header \"$2\" \"$5\"; }; dyff_between"
[diff "echo"]
command = "echo $@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment