繁体   English   中英

Git认为我要推送到其他(不存在)的存储库?

[英]Git thinks i'm pushing to a different (non-existent) repository?

我有一个github帐户,可以推送到该帐户上的其他存储库。

我创建了一个名为Vigenere的存储库,然后将其删除。

我创建了一个名为Vigenere的新存储库,对其进行了克隆。 在Intellij和PUSHED中添加了我的文件。

我懂了

17:32:32.938: [Vigenere-master] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/master:master --set-upstream
error: failed to push some refs to 'https://github.com/MYGITHUB/Vigenere.git'
To https://github.com/MYGITHUB/Vigenere.git
!   refs/heads/master:refs/heads/master [rejected] (fetch first)
hint: Updates were rejected because the remote contains work that you do
Done
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

因此它说尝试git pull。 因此,它告诉我,看起来这些无关的文件完全来自另一个项目!

17:34:55.281: [Vigenere-master] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false pull --progress --no-stat -v --progress origin master
POST git-upload-pack (275 bytes)
remote: Enumerating objects: 3, done.        
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0        
warning: no common commits
From https://github.com/MYGITHUB/Vigenere
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
fatal: refusing to merge unrelated histories

似乎您在本地计算机上创建了一个存储库Vigenere ,然后在Github上创建了一个同名存储库。 Github存储库包含一个带有自述文件的提交。 您的本地存储库不包含相同的提交,但是具有不同的初始提交。

解决方案是再次删除Github存储库,然后重新创建它,而无需自述文件,.gitignore文件或许可证。 这将创建一个空的存储库。 您可以将提交推送到该存储库。

但是没有得到整个问题。 https://github.com/MYGITHUB/Vigenere.git

https://github.com/authentical/Vigenere

是不同的仓库。 我不确定您是否尝试审查,否则可能是原因。

暂无
暂无

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

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