Skip to content

Instantly share code, notes, and snippets.

@jaredly
Last active September 27, 2018 22:24
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 jaredly/1d98e98a4d8ae22b8f75f6d811842c93 to your computer and use it in GitHub Desktop.
Save jaredly/1d98e98a4d8ae22b8f75f6d811842c93 to your computer and use it in GitHub Desktop.
my git config
# Super often, these are muscle memory
alias g=git
alias gs="git status"
alias gb="git b"
alias gd="git diff"
# See the git aliases section, but this is "git branch" but better
# (sorted by most recent, and other things)
alias gr="git r"
# Used as `gitca "commit message"` and it's done
alias gitca="git commit -vam"
# Same, but doesn't add all changes
alias gitc="git commit -vm"
alias gitd='git diff'
alias gaam="git commit -va --amend"
alias gc="git commit -v"
alias gca="git commit -va"
alias gsu="git submodule update --init --recursive"
# Just generally useful
alias ll="ls -l"
alias la="ls -la"
[user]
name = Jared Forsyth
email = jared@jaredforsyth.com
[kaclone]
email = jared@khanacademy.org
[core]
excludesfile = /Users/jared/.gitignore
editor = nvim
[alias]
st = status
s = status
c = commit -v
b = branch
# ain't nobody got time to type "checkout"
o = checkout
co = checkout
# this is just a helper for the following two
branch-name = "!git rev-parse --abbrev-ref HEAD"
# "Push & pull the current branch with the same-named branch @ origin"
push-branch = "!git push origin $(git branch-name)"
pull-branch = "!git pull origin $(git branch-name)"
# I use these a lot, because it means I don't have to remember what the
# upstream was set as
## Open source dev things ##
# These two are for forked repositories that I have, where `origin` is the
# original repo, and `me` is my fork. So I can push up my branch & make a
# pull request
push-me = "!git push me $(git branch-name)"
pull-me = "!git pull me $(git branch-name)"
su = submodule update --init --recursive
# These are all different ways of saying "show me a tree"
tree = log --oneline --decorate --all --graph
tr = log --oneline --decorate --all --graph
t = log --color --date-order --graph --oneline --decorate --simplify-by-decoration --branches
ta = log --color --date-order --graph --oneline --decorate --simplify-by-decoration --all
# I don't end up using mergetool as much now, I just use vscode
mt = mergetool
# "short log"
sl=log --pretty=format:'%C(yellow)%h %Cblue%>(12)%ad %Cgreen%<(7)%aN%Cred%d %Creset%s' --date=relative
# This is "list branches", but much better than "git branch". Sorts by recency & shows nice things.
r=for-each-ref --count=10 --sort=-committerdate refs/heads/ --format='%(HEAD) \
%(color:green)%(align:width=25,position=left)%(refname:short)%(end)\
%(color:black)%(align:width=3,position=left)%(upstream:trackshort)%(end)\
%(align:width=25,position=left)%(upstream:short)%(end)\
%(committerdate:relative)'
br=for-each-ref --count=10 --sort=-committerdate refs/heads/ --format='%(HEAD) \
%(color:green)%(align:width=25,position=left)%(refname:short)%(end)\
%(color:black)%(align:width=3,position=left)%(upstream:trackshort)%(end)\
%(align:width=25,position=left)%(upstream:short)%(end)\
%(committerdate:relative)'
[merge]
tool = vimdiff
renamelimit = 10000
[colors]
ui = true
ui = true
[color]
ui = true
[push]
default = simple
[credential]
helper = osxkeychain
[include]
path = ~/.gitconfig.khan
[github]
user = jaredly
[ghi]
[ghi]
token = !security find-internet-password -a jaredly -s github.com -l 'ghi token' -w
[filter "lfs"]
required = true
clean = git-lfs clean %f
smudge = git-lfs smudge %f
[help]
autocorrect = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment