简体   繁体   English

无法使用git pull“找不到远程引用–-allow-unrelated-histories”

[英]Fail to use git pull “Couldn't find remote ref –-allow-unrelated-histories”

push to github,but merge fail,Fail to use git pull "Couldn't find remote ref allow-unrelated-histories" 推送到github,但是合并失败,无法使用git pull“找不到远程引用allow-unrelated-histories”

I come up with a problem about git pull. 我想到了有关git pull的问题。 first,I 'm add remote, 首先,我要添加遥控器

git init 
git add .
git remote add origin https://github.com/xxx/xxxx.git

success Then I use git push and got an error message, 成功然后我使用git push并收到一条错误消息,

refusing to merge unrelated histories so i use below,but got extra message refusing to merge unrelated histories所以我在下面使用,但是得到了额外的消息

git pull origin master --allow-unrelated-histories

Fail to use git pull "Couldn't find remote ref allow-unrelated-histories" Oh,god,I don't know what to do,please help me 未能使用git pull“找不到远程引用允许-无关的历史记录”哦,上帝,我不知道该怎么办,请帮帮我

Options to pull (such as the merge option --allow-unrelated-histories ) must come before the remote name and refspec, because there could be any number of refspec arguments. pull选项(例如合并选项--allow-unrelated-histories )必须位于远程名称和refspec之前,因为可以有任意数量的refspec参数。

git pull --allow-unrelated-histories origin master

However, unless you know why you are combining unrelated histories, this may not be a good idea. 但是,除非您知道为什么要合并无关的历史记录,否则这可能不是一个好主意。 It is not typical that you would need to do this, and instead of chasing error messages you may need to take a step back and be sure it's totally clear why the original pull isn't doing what you expected. 通常不需要这样做,而不是追逐错误消息,您可能需要退后一步,并确保完全清楚为什么原始拉动无法达到您的预期。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM