Skip to content

Instantly share code, notes, and snippets.

@jaredly jaredly/.bash_profile
Last active Sep 27, 2018

What would you like to do?
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"
name = Jared Forsyth
email =
email =
excludesfile = /Users/jared/.gitignore
editor = nvim
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) \
br=for-each-ref --count=10 --sort=-committerdate refs/heads/ --format='%(HEAD) \
tool = vimdiff
renamelimit = 10000
ui = true
ui = true
ui = true
default = simple
helper = osxkeychain
path = ~/.gitconfig.khan
user = jaredly
token = !security find-internet-password -a jaredly -s -l 'ghi token' -w
[filter "lfs"]
required = true
clean = git-lfs clean %f
smudge = git-lfs smudge %f
autocorrect = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.