Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Git Aliases
[alias]
a = add .
aliases = config --get-regexp alias
b = branch
bi = bisect
ci = commit -m
co = checkout
colast = checkout -
db = branch -D
laf = fsck --lost-found
last = log -1 HEAD
lc = diff HEAD^ HEAD
nb = checkout -b
pror = remote prune origin
pr = pull --rebase
pf = push --force-with-lease
psu = push --set-upstream
ra = rebase --abort
rc = rebase --continue
remotes = remote -v
renb = branch -m
rhh = reset --hard HEAD
rh = reset --hard
sfc = diff-tree --no-commit-id --name-only -r
s = status -s
stashes = stash list
unstash = stash pop
vc = clean -dfx
refactor = commit -m "👷‍♀️Refactor"
formatting = commit -m "💅Formatting"
comments = commit -m "📒Comments"
tests = commit -m "✅Tests"
@nickytonline

This comment has been minimized.

Show comment
Hide comment
Owner

nickytonline commented Sep 10, 2016

@wesbos has some good ones he posted here, http://wesbos.com/git-hot-tips/

@nickytonline

This comment has been minimized.

Show comment
Hide comment
@nickytonline

nickytonline Sep 29, 2016

I always forget the command for creating an alias so adding this one alias = "!sh -c \"git config --global alias.$1 $2\" -"

Owner

nickytonline commented Sep 29, 2016

I always forget the command for creating an alias so adding this one alias = "!sh -c \"git config --global alias.$1 $2\" -"

@nickytonline

This comment has been minimized.

Show comment
Hide comment
@nickytonline

nickytonline Sep 30, 2016

Not aliases, but a nice companion to aliases is TJ's git-extras, https://github.com/tj/git-extras

Owner

nickytonline commented Sep 30, 2016

Not aliases, but a nice companion to aliases is TJ's git-extras, https://github.com/tj/git-extras

@nickytonline

This comment has been minimized.

Show comment
Hide comment
@nickytonline

nickytonline Oct 3, 2016

I also use zsh with Oh My zsh, https://github.com/robbyrussell/oh-my-zsh. glog is great.

Owner

nickytonline commented Oct 3, 2016

I also use zsh with Oh My zsh, https://github.com/robbyrussell/oh-my-zsh. glog is great.

@nickytonline

This comment has been minimized.

Show comment
Hide comment
Owner

nickytonline commented Feb 17, 2017

This is a good one too https://gist.github.com/gnarf/5406589

@nickytonline

This comment has been minimized.

Show comment
Hide comment
@nickytonline

nickytonline Feb 22, 2017

Here's one to rename a local branch as I never remember the syntax: renb = branch -m

Owner

nickytonline commented Feb 22, 2017

Here's one to rename a local branch as I never remember the syntax: renb = branch -m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment