I do not think there is a built-in command for this. However, you can do something like this:
#!/bin/bash head=$(git symbolic-ref HEAD) || exit head=${head#refs/heads/} merge=$(git config --get branch.$head.merge) || { echo "no tracking branch"; exit 1; } remote=$(git config --get branch.$head.remote) || remote=origin git merge $remote/${merge#refs/heads/}
I think I covered my bases well - it exits with a failure status if it is in the offline state of HEAD, or if the current branch does not have a tracking branch. By default, the source is used, as are the usual git transfer commands. (Something strange will happen if you try to use it on a branch that tracks something other than the branch on the remote, that is, not in the form of refs / heads / *, but that seems unlikely.) It doesn't seem like it 'd actually save you a lot of time, but here you are!
If you want to use it, just save it somewhere and execute its alias or name it git -something and put it in your PATH.
source share