Alias git to pull current branch

posted on 03 March 2020

Git 2.22 onwards has a current branch flag, with git branch —show-current allows you to see which brach you are at now, sometime you want to pull current branch changes, and the easiest config in my opinion is to set a alias in your bash_profile or zshrc without messing your git config settings.

now you just need to type gp, it will pull your current branch origin.

This can be quite useful for many other things, for example I am also using it to bind to git reflog

Hope you enjoy this kind of git binding.