gpt4 book ai didi

混帐 pull : tell it which branch to merge with

转载 作者:行者123 更新时间:2023-12-02 15:37:21 25 4
gpt4 key购买 nike

所以问题是,我有一个 git 存储库,我想将它上传到 GitHub。我在 SOF 上运行了多个线程,它建议使用 git push -u origin master。问题是,当我这样做时,它告诉我需要先 merge ,这样我才不会丢失任何数据。所以它向我建议 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.

我该如何解决这个问题?

编辑:没关系,我刚刚解决了这个问题。如果你们遇到这样的问题,请执行以下操作: pull

最佳答案

假设你的分支叫做master,远程叫做origin:

git pull origin master

如果您还没有设置 Remote ,执行此操作的命令是:

git remote add origin git@github.com:username/repository.git

在这两种情况下,Origin 只是 github 远程的通用名称。将 username 替换为您的用户名,将 repository 替换为您的存储库名称。之后,您将能够将您的 github 存储库称为“来源”。

关于混帐 pull : tell it which branch to merge with,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14953158/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com