Skip to content

Instantly share code, notes, and snippets.

@SunnyBingoMe
Last active April 12, 2022 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SunnyBingoMe/f24d100e0f6a4be3ab1b7ff0dfc99479 to your computer and use it in GitHub Desktop.
Save SunnyBingoMe/f24d100e0f6a4be3ab1b7ff0dfc99479 to your computer and use it in GitHub Desktop.
warn: autocrlf for windows only !!!
[user]
name = Sunny
email = Sunny
[diff]
tool = vimdiff
[difftool]
prompt = true
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
whitespace = red reverse
[alias]
# see `git help log` for detailed help. https://tinyl.io/5vaw
# %h: abbreviated commit hash
# %d: tag (ref names), like the --decorate option of git-log(1)
# %cn: commiter name
# %ce: committer email
# %cr: committer date, relative
# %ci: committer date ISO 8601 (overwrite short)
# %an: author name
# %ae: author email
# %ar: author date, relative
# %ai: committer date ISO 8601 (overwrite short)
# %s: subject
st = status
ci = commit
br = branch
co = checkout
dfetch = diff FETCH_HEAD
dtfetch = difftool FETCH_HEAD
d = difftool
dc = diff --cached
discard = "!f() { git reset --hard HEAD; git clean -fd; }; f"
# reset will undo modifications; clean will delete new (untracked) Files and Directories.
createCOB = checkout -b
l = log --graph --date=short --pretty=format:'%C(auto)%h%Creset %C(bold yellow)%d%C(reset) %C(cyan)%ad%Creset %s'
lg = log --graph --date=short --pretty=format:'%C(auto)%h%Creset %C(bold yellow)%d%C(reset) %C(cyan)%ad (%ar)%Creset %s'
lg2 = log --graph --all --format=format:'%C(yellow)%h%C(reset) - %C(bold green)(%ai)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit
lg2r = log --graph --all --format=format:'%C(yellow)%h%C(reset) - %C(bold green)(%ai) (%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit
lg3 = log --graph --all --format=format:'%C(yellow)%h%C(reset) - %C(bold green)(%ai)%C(reset) %C(bold cyan)(%ar, %aD)%C(reset) %C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit
lol = log --graph --pretty=format:'%C(auto)%h%d%Creset %C(cyan)(%ai)%Creset %C(green)%cn <%ce>%Creset %s'
lg9 = log -p
[branch]
autosetuprebase = always
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore_global
# for win users CRLF: !!! windows only !!!
autocrlf = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment