git pull:告诉它要合并哪个分支

Jef*_*eff 1 git github

所以问题是,我有一个git存储库,我想将它上传到GitHub.我在SOF上运行了多个线程,它建议使用git push -u origin master.问题是,当我这样做时它告诉我我需要先合并,所以我不会丢失任何数据.所以它建议给我git pull.我做了,这就是我得到的:

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
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
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 "master"]
    remote = <nickname>
    merge = <remote-ref>

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

See git-config(1) for details.
Run Code Online (Sandbox Code Playgroud)

我该如何解决?

编辑:没关系,我只是解决了这个问题.如果你们遇到这样的问题:git pull

Joh*_*son 6

假设您的分支被称为master并且远程称为origin:

git pull origin master
Run Code Online (Sandbox Code Playgroud)

如果尚未设置远程,则执行此操作的命令为:

git remote add origin git@github.com:username/repository.git
Run Code Online (Sandbox Code Playgroud)

两种情况下的原点只是github遥控器的通用名称.使用您的存储库名称替换用户名和存储库的用户名.之后,您将能够将您的github存储库称为"origin".