Skip to content

Instantly share code, notes, and snippets.

@AndreiRailean
Last active January 30, 2017 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AndreiRailean/3e5c2115ddee8bd7ceed to your computer and use it in GitHub Desktop.
Save AndreiRailean/3e5c2115ddee8bd7ceed to your computer and use it in GitHub Desktop.
Aliases for Git Config
[user]
name = Andrei Railean
email = andrei@siter.com.au
[alias]
co = checkout
cob = checkout -b
st = status
s = status
ci = commit
c = commit
br = branch
last = log -1 HEAD
a = add
d = diff
mum = merge upstream/master
fu = fetch upstream
mm = merge master
rum = rebase upstream/master
ca = commit --amend
# Unstage any files that have been added to the staging area
unstage = reset HEAD
# Show changes that have been staged
diffc = diff --cached
# wc == what changed
wc = diff-tree --no-commit-id --name-status -r
# Mark a file as "assume unchanged", which means that Git will treat it
# as though there are no changes to it even if there are. Useful for
# temporary changes to tracked files
assume = update-index --assume-unchanged
# Reverse the above
unassume = update-index --no-assume-unchanged
# Show the files that are currently assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
# Delete any branches that have been merged into master
# See also: https://gist.github.com/robmiller/5133264
delete-merged-branches = "!git co master && git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
# Checkout our version of a file and add it
ours = "!f() { git checkout --ours $@ && git add $@; }; f"
# Checkout their version of a file and add it
theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
# Search/grep your entire codebase for a string:
grep = grep -Ii
gr = grep -Ii
[core]
editor = vim
ignorecase = false
[push]
default = matching
[credential]
helper = osxkeychain
[commit]
gpgsign = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment