Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Magnum97/b8b93c287e57f156fb53f8dc84637dec to your computer and use it in GitHub Desktop.
Save Magnum97/b8b93c287e57f156fb53f8dc84637dec to your computer and use it in GitHub Desktop.
GIT Configurations: Alias to Push/Pull automatically on working branch, nice git log format #git
#include this in your .gitconfigure to perform a pull/push origin on the branch you are currently working
# avoids mistakes performing 'pull origin master' when you are in stable and so on
#
[alias]
# Pushes/pulls to/from remote branch with corresponding name
pl = !git pull origin $(git symbolic-ref HEAD | sed -e 's,.*/\\(.*\\),\\1,')
ps = !git push origin $(git symbolic-ref HEAD | sed -e 's,.*/\\(.*\\),\\1,')
# nice git log format
[format]
pretty=format:%C(yellow)%h%Creset -%C(red)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment