Useful Git Config Aliases

To setup, add these to your .gitconfig.

$ cat .gitconfig-aliases >> ~/.gitconfig
Shorter syntax to add new files
$ git a .
Apply unstaged changes to the previous commit
$ git amend
Put the current branch name in your clipboard (Mac Only, needs pbcopy)
$ git b

# ... CMD+V
Remove local branches already merged to master (or another branch)
# Remove local branches merged to master
$ git bclean

# Remove local branches merged to develop
$ git bclean develop
Shorter syntax to remove a branch
$ git bd some-branch
Shorter syntax to git diff with Color
$ git d
$ git d some-branch
$ git d HEAD~1
Search remote branch names
$ git find ma

# origin/HEAD -> origin/master
# origin/master
Shorter syntax to prune remote branches
$ git grp
Log with lines of change
$ git l
Log with list of files changed
$ git ll
Log history for a specific file
$ git logfile ./somefile.js
Log with diff of files changed
$ git lp
Log with color, condensed
$ git ls
Shorter syntax to checkOUT or "open"
$ git o some-branch
Shorter syntax to checkout previous branch
$ git checkout master
$ git checkout some-branch
$ git p
Push to remote origin
$ git pb
Safer Force Push after rebase (prevents overwriting others)
$ git pf
Show recent branches
$ git recent
Shorter syntax for status
$ git s
Undo previous commit leaving changes unstaged locally
$ git undo
Better git pull
$ git up
Commit all unstaged changes and new files to "work-in-progress" commit. Works great with git amend and git undo
$ git wip