Skip to content

Instantly share code, notes, and snippets.

@nickytonline
Last active February 17, 2021 03:34
Show Gist options
  • Save nickytonline/128d7d164d1eea5daba6753ed0829f41 to your computer and use it in GitHub Desktop.
Save nickytonline/128d7d164d1eea5daba6753ed0829f41 to your computer and use it in GitHub Desktop.
Git Aliases
alias.a add .
alias.aliases config --get-regexp alias
alias.bi bisect
alias.ci commit -m
alias.co checkout
alias.colast checkout -
alias.db branch -D
alias.laf fsck --lost-found
alias.last log -1 HEAD
alias.nb checkout -b
alias.pror remote prune origin
alias.pr pull --rebase
alias.pf push --force-with-lease
alias.psu push --set-upstream
alias.ra rebase --abort
alias.rc rebase --continue
alias.remotes remote -v
alias.renb branch -m
alias.rhh reset --hard HEAD
alias.rh reset --hard
alias.s status -s
alias.stashes stash list
alias.unstash stash pop
alias.vc clean -dfx
alias.refactor commit -m 👷Refactor
alias.formatting commit -m 💅Formatting
alias.comments commit -m 📒Comments
alias.tests commit -m ✅Tests
alias.prum pull --rebase upstream master
alias.mend commit --amend
@nickytonline
Copy link
Author

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

@nickytonline
Copy link
Author

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

@nickytonline
Copy link
Author

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

@nickytonline
Copy link
Author

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

@nickytonline
Copy link
Author

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

@nickytonline
Copy link
Author

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