Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
148 lines (129 sloc) 4.05 KB
# correct typos
[help]
autocorrect = 1
[core]
pager = diff-so-fancy | less --tabs=4 -RFX
editor = vim
[alias]
a = add
A = add -A
b = branch
del = branch -D
rename = "!git branch -m $2 $3 && git push $1 :$2 $3 -u #"
c = commit
amend = commit --amend
cl = clone
co = checkout
contains = describe --all --contains
d = diff
d = diff
ds = diff --staged
dt = difftool
f = fetch
graph = log --graph --pretty=oneline --abbrev-commit --decorate --all
l = log
last = log -1 HEAD
m = merge
mt = mergetool
master = co master
p = push
pu = pull
r = reset
hard = reset --hard
soft = reset --soft
unstage = reset HEAD
re = rebase
s = status
sa = submodule add
si = submodule init
su = submodule update
ss = submodule status
st = stash
save = stash save
pop = stash pop
sub = submodule
t = tag
set-url = remote set-url origin
modified = ls-files --modified --others --exclude-standard
# custom functions
changelog = "!git log --oneline --no-merges $1..HEAD"
difference = "!git log --oneline $1..$2"
# refresh the date of commits
refresh = "!git rebase HEAD~$1 --ignore-date"
local = "!git log --oneline --no-merges origin/$(git rev-parse --abbrev-ref HEAD).."
mindiff = diff -w --word-diff-regex=. --color-words -U0
overview = log --all --since='2 weeks' --oneline --no-merges
recent = for-each-ref --count=10 --sort=-committerdate refs/heads/ --format="%(refname:short)"
sneak = commit -a --amend --no-edit
stats = shortlog -sn
today = "!git log --since='00:00:00' --all --no-merges --oneline --author=$(git config user.email)"
wdiff = diff --word-diff
upstream = "!git fetch && git log --oneline --no-merges ..origin/$(git rev-parse --abbrev-ref HEAD)"
zip-modified = "!zip modified.zip $(git modified)"
# github(hub) shortcuts
view = browse --
code = browse --
issues = browse -- issues
pulls = browse -- pulls
wiki = browse -- wiki
projects = browse -- projects
insights = browse -- insights
settings = browse -- settings
releases = browse -- releases
# this function allows you to go through hub low level api with or without multiple pages
paginate = "!paginate() { local output cursor; output=\"$(\"$@\")\"; cursor=\"$(awk '/\\.hasNextPage/ { has_next=$2 } /\\.endCursor/ { if (has_next==\"true\") print $2 }' <<<\"$output\")\"; printf \"%s\\n\" \"$output\"; [ -z \"$cursor\" ] || paginate \"$@\" -f after=\"$cursor\"; }; paginate "
user = "!hub api --flat user | grep -e '\\.login' | awk '/.login/ {print $2}'"
repos = "!repos() { local user=\"${1?}\";shift 1; git paginate hub api -t graphql -f user=\"$user\" \"$@\" \
-f query='query($user: String!, $per_page: Int = 100, $after: String) { user(login: $user) { \
repositories(first: $per_page, after: $after) { nodes { nameWithOwner }, pageInfo { hasNextPage, endCursor } } } }';}; \
repos \"$(git user)\" | awk '/\\.nameWithOwner\\t/ { print $2 }';"
repo = "!hub api \"repos/{owner}/{repo}\" --flat | awk '/\\.full_name\\t/ { print $2 }'"
rename-repo = "!f() { hub api --flat -XPATCH repos/{owner}/{repo} -f name=$1 | grep -e '\\.ssh_url' | awk '/.ssh_url/ {print $2}' | xargs git set-url; }; f"
comment = "!hub api \"repos/{owner}/{repo}/issues/$1/comments\" --raw-field \"body=$2\""
# push easily. http://stackoverflow.com/a/23918418/89484
[push]
default = current
# use separate file for username / github token / etc
[include]
path = ~/.gitconfig.local
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true
[color "diff"]
meta = yellow
commit = yellow
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "status"]
added = yellow
changed = green
untracked = cyan
[mergetool]
keepBackup = false
tool = meld
[diff]
tool = meld
[difftool]
prompt = false
[difftool "meld"]
cmd = meld "$LOCAL" "$REMOTE"
[credential]
helper = !aws codecommit credential-helper $@
UseHttpPath = true
[hub]
protocol = ssh
You can’t perform that action at this time.