我发现 git docs 关于这个问题非常神秘。我想做一件简单的事,但做起来似乎一点也不简单。
我有以下情况:
$ git remote -v
origin git://192.168.0.49/mnt/repos
stick /mnt/titanium/podaci/repos
我可以使用git pull从原点获取和合并,效果很好:
$ git pull
Already up-to-date.
我可以像这样从棍子上拉出来:
$ git pull stick master
Already up-to-date.
但是,当我在没有主部件的情况下从棒中拉出时,我收到以下消息:
$ git pull stick
From /mnt/titanium/podaci/repos
* [new branch] su2009 -> stick/su2009
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me either. Please
name which branch you want to merge on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details on the refspec.
If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:
branch.master.remote = <nickname>
branch.master.merge = <remote-ref>
remote.<nickname>.url = <url>
remote.<nickname>.fetch = <refspec>
See git-config(1) for details.
有些事情让我感到困惑。“你的配置文件”在这里是什么意思?我应该编辑哪个文件,我应该输入什么?在这种情况下昵称是什么?
I would expect that what I'm trying to accomplish is very common, but I haven't been able to find a straight-to-the-point answer with an example.