Skip to content

Instantly share code, notes, and snippets.

@TheFrostlixen
Last active November 4, 2016 01:53
Show Gist options
  • Save TheFrostlixen/20ba1f3987006204c1a0 to your computer and use it in GitHub Desktop.
Save TheFrostlixen/20ba1f3987006204c1a0 to your computer and use it in GitHub Desktop.
Portable Git Config File
[user]
name = Matt Fredrickson
email = mgfredrickson@nevada.unr.edu
[push]
default = simple
[url "https://thefrostlixen@github.com"]
insteadOf = https://github.com
[alias]
c = commit -m
ls = status
# show the commit history in a nice format
history = log --pretty=oneline
# revert repo to last known good commit
re = add . && reset --hard HEAD
# unstage all (or specified) files
unstage = reset --
# undo previous commit, but keeps tracking files from before
uncommit = reset --soft HEAD^
# undo commit and untrack files, but keep all changes (same as uncommit + unstage)
undo = reset --mixed HEAD^
# undo commit and reset tracked files to previous commit (completely clean reset to previous version)
nuke = reset --hard HEAD^
# create new branch and push to repo host
newbranch = checkout -b $1 && push origin $1
# move current work to a different branch
moveto = stash && checkout $1 && stash pop
# commit files modified (includes deleted files, but not new/untracked files)
ac = commit -a -m
# commit with a funny message
what = commit -m "`wget -qO- http://whatthecommit.com/index.txt`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment