How to pull your git tree after creating it on remote server

Currently, I have created my branch dev-harry but I cannot pull it successfully as follows.

harryxiyou@common_vm ~/forest/kvplus/kvplus $ git branch
* dev-harry
  master
  rc
harryxiyou@common_vm ~/forest/kvplus/kvplus $ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.dev-harry.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull  ').
See git-pull(1) for details.

If you often merge with the same branch, you may want to
use something like the following in your configuration file:

[branch "dev-harry"]
remote = <nickname>
merge = <remote-ref>

[remote "<nickname>]
url = <url>
fetch = <refspec>

See git-config(1) for details.

However, when I checkout to rc branch, it works well. I am looking for the reasons.

harryxiyou@common_vm ~/forest/kvplus/kvplus $ git checkout rc
Switched to branch 'rc'
Your branch is behind 'origin/rc' by 3 commits, and can be fast-forwarded.
harryxiyou@common_vm ~/forest/kvplus/kvplus $ git pull
Updating 4ada91a..732d9b7
Fast-forward
 src/kv.c0 |   60 ++++++++++++++++++++++++------------------------------------
 1 files changed, 24 insertions(+), 36 deletions(-)

Usually, adding these lines to .git/conf is fine:

[branch "dev-harryxiyou"]
    remote = origin
    merge = refs/heads/dev-harryxiyou

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *