Skip to content

Instantly share code, notes, and snippets.

@joallard
Last active June 10, 2020 20:33
Show Gist options
  • Save joallard/821caf62036c92e4fafba8ec7b868405 to your computer and use it in GitHub Desktop.
Save joallard/821caf62036c92e4fafba8ec7b868405 to your computer and use it in GitHub Desktop.
[user]
name = Jonathan Allard
email = jonathan@allard.io
[alias]
children = "!git rev-list HEAD..master | tail"
co = checkout
cp = cherry-pick
cpc = cherry-pick --continue
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
ri = rebase --interactive
rc = rebase --continue
## gum aliases for git version 3 ##
# tell git to ignore a file
ignore="!f() { [ -z "$@" ] && echo "git: usage git ignore [file]" || ( ([ ! -e .gitignore ] && touch .gitignore); echo $1 >>.gitignore && echo "Ignoring file $1" && git rm --cached "$@" > /dev/null 2>&1 && git st ); }; f"
#add files to the staging area
freeze="!f() { ( [ -z $@ ] && git add -A || git add -A "$@" ) && git st; }; f"
# remove files from the staging area
unfreeze="!f() { ([ -z "$@" ] && (git reset -q HEAD > /dev/null 2>&1 || echo "first commit must be unfrozen file by file. better error message coming soon") || (git reset -q HEAD -- $@ > /dev/null 2>&1 || git rm -q --cached $@ ) ) && git st; }; f"
# Show short status with current branch name
st="!f() { br=$(git status | head -1) && echo "${br}" && git status -s; }; f"
# Navigate through the log - eventually allow for git history back and
# git history forward to flip through old versions like mac time
# machine
history=log
[push]
default = upstream
[core]
# pager = diff-so-fancy | less --tabs=4 -RFX
[merge]
tool = vimdiff
[gui]
tabsize = 2
[diff]
compactionHeuristic = true
[color "status"]
# staged
added = blue
# unstaged
changed = yellow
# untracked
untracked = cyan
[color "diff"]
# old = red
new = blue
[color]
ui = true
[pull]
rebase = true
[github]
user = joallard
[ghi]
token = !security find-internet-password -a joallard -s github.com -l 'ghi token' -w
[rebase]
autosquash = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment