Skip to content

Instantly share code, notes, and snippets.

@matthewjberger
Created May 18, 2016 00:58
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 matthewjberger/ec1f1b31dc70581a517089617cfc723f to your computer and use it in GitHub Desktop.
Save matthewjberger/ec1f1b31dc70581a517089617cfc723f to your computer and use it in GitHub Desktop.
[user]
name = Matthew J. Berger
email = matthewberger@nevada.unr.edu
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser = matthewberger@nevada.unr.edu
smtpserverport = 587
[credential]
username = matthewjberger
helper = cache --timeout 3600
[web]
browser = chrome
[rerere]
# Reuse Recorded Resolution
# allows git to remember how a hunk conflict has been resolved
# and remembers for next time
enabled = 1
autoupdate = 1
[push]
# Only push branches one at a time
default = simple
[color]
ui = auto
[color "branch"]
# Alter coloring by branch
current = yellow bold
local = green bold
remote = cyan bold
[color "diff"]
meta = yellow bold
frag = magenta bold
ld = red bold
new = green bold
whitespace = red reverse
[color "status"]
added = green bold
changed = yellow bold
untracked = red bold
[difftool]
tool = vimdiff
[github]
user = matthewjberger
token = token
[gitflow "prefix"]
feature = feature-
release = release-
hotfix = hotfix-
support = support-
versiontag = v
[url "https://matthewjberger@github.com"]
insteadOf = https://github.com
[alias]
# Stage all files
a = add --all
# Modify previous commit
amend = commit -a --amend
# Checkout file
co = checkout
# Create new branch but don't push it to the repo host
cob = checkout -b
# Commit with a message
com = commit -m
# Add and commit all changes
comma = !git add -A && git commit -m
# Clone self repo
cs = "!sh -c \"git clone https://github.com/matthewjberger/$1\" -"
# Clone self repo recursive
csr = "!sh -c \"git clone --recursive https://github.com/matthewjberger/$1\" -"
# Clone user repo
cu = "!sh -c \"git clone https://github.com/$1\" -"
# Clone user repo recursive
cur = "!sh -c \"git clone --recursive https://github.com/$1\" -"
# Edit config with vim
ec = config --global -e
# Show last commit
last = show --name-status
# Show all commits on all branches in a compact, colorized way
histories = !git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
# Show the commit history in a nice format
history = log --pretty=oneline
# Move current work to a different branch
moveto = "!sh -c \"git stash && git checkout $1 && git stash pop\" -"
# Create new branch and push to repo host
newbranch = "!sh -c \"git checkout -b $1 && git push --set-upstream origin $1\" -"
# Has the same effect as deleting the entire repo and re-cloning
# Except it doesn't delete files in the .gitignore, to be safe
nuke = "!sh -c \"git checkout $1 && git stash -u && git fetch --all && git reset --hard origin/$1 && git clean -x -d -f && git submodule init && git submodule update\" -"
# Quick commit to save progress
save = !git add -A && git commit -m 'SAVEPOINT'
# Get the current status
st = status
# Get the concise version of the current status
sts = status -s
# Undo commit but keep changes
undo = reset HEAD~1 --mixed
# Unstage all (or specified) files
unstage = reset HEAD --
# Get up to date with the origin (Use if you have local commits)
# This rebases local commits to come after any commits that are pulled down
# --prune removes remote-tracking branches that no longer exist on the remote
# This also ensures submodules are recursively updated
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
# Update submodules recursively. Point them to latest commit.
upsub = !git submodule update --remote --merge
# Undo commit and discard changes
# Commits everything in working directory and does a hard reset to remove that commit
# This is safer than simply discarding changes for good
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment