I just did this:
git pull origin "$(git branch | grep -E '^\* ' | sed 's/^\* //g')"
or
git pull origin $(git rev-parse --abbrev-ref HEAD)
This extracts the current branch from git branch and pulls this branch from a remote source.
Note that, as Set Robertson said, when no arguments are given, only the current branch changes, but all deleted branches are selected. I do not want to receive all deleted branches, so I did it like this.
ayke Apr 27 '14 at 21:44 2014-04-27 21:44
source share