Skip to content

Instantly share code, notes, and snippets.

@gapple
Last active December 18, 2017 21:38
Show Gist options
  • Save gapple/10314289 to your computer and use it in GitHub Desktop.
Save gapple/10314289 to your computer and use it in GitHub Desktop.
Git user configuration
[url "ssh://git@github.com/"]
insteadOf = gh:
[url "ssh://git@gist.github.com/"]
insteadOf = gist:
[url "git@bitbucket.org:"]
insteadOf = bb:
[url "gapple@git.drupal.org:project/"]
insteadOf = drupal:
[core]
excludesfile = ~/.gitignore_global
editor = nano
pager = diff-so-fancy | less --tabs=4 -RFX
[color]
ui = true
[push]
default = current
[diff]
algorithm = patience
renames = true
compactionHeuristic = true
[diff-so-fancy]
stripLeadingSymbols = false
[alias]
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%an]%Cgreen\\ %ar" --decorate --graph
lsa = log --date=relative --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%an]%Cgreen\\ %ar" --decorate --graph --all
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%an]%Cgreen\\ %ar" --decorate --numstat
cp = cherry-pick
s = status -s -b
st = status -s -b
cl = clone
ci = commit
co = checkout
f = fetch
fa = fetch --all
# Fetch a specific remote branch into a remote ref.
# e.g. frb upstream branch-name
frb = "!f() { git fetch $1 $2:remotes/$1/$2; }; f"
# Fetch a specific remote branch into a local branch.
# Unfortunately the local branch cannot be set to track the remote
# branch if the branch is not in the remote's fetch refspec
frbl = "!f() { git fetch $1 $2:remotes/$1/$2; git branch $2 $1/$2; }; f"
br = branch
brm = branch --merged
brnm = branch --no-merged
d = diff --word-diff
diff = diff --word-diff
dc = diff --cached
fo = fetch origin
fu = fetch upstream
po = push origin
ss = stash save
sp = stash pop
sl = stash list
sd = stash drop
untrack = update-index --assume-unchanged
retrack = update-index --no-assume-unchanged
permission-reset = "!git diff -p | grep -E \"^(diff|old mode|new mode)\" | sed -e \"s/^old/NEW/;s/^new/old/;s/^NEW/new/\" | git apply"
delete-merged = "!git branch --merged | grep -v \"*\" | grep -v \"master\" | grep -v \"develop\" | xargs -n 1 git branch -d"
prune-all = "!git remote | xargs -n 1 git remote prune"
# Temporary and OS Files
*~
.DS_Store
.sass-cache
node_modules
# PHP archives (e.g. composer)
*.phar
# IDE Files
## PHPStorm
.idea
## Sublime
*.sublime-*
# Files that must be manually added
*.psd
# Drupal development modules
**/sites/*/modules/**/devel
**/sites/*/modules/**/xhprof
**/sites/*/modules/**/stage_file_proxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment