Skip to content

Instantly share code, notes, and snippets.

@Tranquility2
Created June 23, 2021 06:45
Show Gist options
  • Save Tranquility2/e83300c0240a01458287332a533ebc14 to your computer and use it in GitHub Desktop.
Save Tranquility2/e83300c0240a01458287332a533ebc14 to your computer and use it in GitHub Desktop.
Git's configuration file
1 .gitconfig X
# This is Git's per-user configuration file.
[user]
name = <user>
email = <email>
[alias]
# Base
co = checkout
dt = difftool
cm = commit
cma = "commit -a"
s = status
ps = push
p = pull
a = add
aa = "add --all"
ai = "add --interactive"
b = branch
f = fetch
rb = rebase
grep = grep -Ii
gr = grep -Ii
# logs (http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs)
lg1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
lg2 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit
lg = !"git lg1"
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
lsh = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate -n10
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate -- numstat
[color]
ui = true
[push]
default = tracking
[credential]
helper = cache
[core]
pager = less -F -X
autocrlf = false
[remote "origin"]
prune = true
[url "git@bitbucket.org:"]
insteadOf = https://bitbucket.org/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment