Skip to content

Instantly share code, notes, and snippets.

@talalUcef
Created November 11, 2020 12:45
Show Gist options
  • Save talalUcef/dfe0a5bfc91943de62856b6c324cfa29 to your computer and use it in GitHub Desktop.
Save talalUcef/dfe0a5bfc91943de62856b6c324cfa29 to your computer and use it in GitHub Desktop.
Git config example file
[http]
proxy = http://host:port
[user]
name = Name
email = mail
[alias]
# current branch, complete subject
l = log --graph --abbrev-commit --date=relative --pretty=format:'%C(yellow)%h%Creset%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
# all branches, complete subject
la = log --graph --abbrev-commit --date=relative --all --pretty=format:'%C(yellow)%h%Creset%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
# current branch, truncated & justified subject
lg = log --graph --date-order --format='%C(yellow)%h%Creset %<(90,trunc)%s %Cgreen(%cr) %C(bold blue)<%an>%Creset%C(auto)%d%Creset'
# all branches, truncated & justified subject
lga = log --graph --date-order --all --format='%C(yellow)%h%Creset %<(90,trunc)%s %Cgreen(%cr) %C(bold blue)<%an>%Creset%C(auto)%d%Creset'
# current branch, file stats, truncated & justified subject
lf = log --graph --name-status --format='%C(yellow)%h%C(bold white) %<(90,trunc)%s %Cgreen(%cr) %C(bold blue)<%an>%Creset%C(auto)%d%Creset'
# all branches, file stats, truncated & justified subject
lfa = log --graph --name-status --all --format='%C(yellow)%h%C(bold white) %<(90,trunc)%s %Cgreen(%cr) %C(bold blue)<%an>%Creset%C(auto)%d%Creset'
# current branch, absolute date, truncated & justified subject
ld = log --graph --date=short --format='%C(yellow)%h%Creset %<(90,trunc)%s %Cgreen(%cd) %C(bold blue)<%an>%Creset%C(auto)%d%Creset'
# current branch, absolute date, truncated & justified subject
lda = log --graph --date=short --all --format='%C(yellow)%h%Creset %<(90,trunc)%s %Cgreen(%cd) %C(bold blue)<%an>%Creset%C(auto)%d%Creset'
# status
st = status
# delete old branches from local repository
delete = "!f(){ git fetch --all -p; git branch -vv | grep ': gone]' | awk '{ print $1 }' | xargs -n 1 git branch -D;};f"
[branch]
autosetuprebase = always
[color]
ui = true
[credential]
helper = store
[core]
editor = vim
[pull]
default = current
[push]
default = current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment