我有一个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
答案 0 :(得分:2)
似乎您在本地计算机上创建了一个存储库Vigenere
,然后在Github上创建了一个同名存储库。 Github存储库包含一个带有自述文件的提交。您的本地存储库不包含相同的提交,但是具有不同的初始提交。
解决方案是(再次)删除Github存储库并重新创建它,而无需自述文件,.gitignore文件或许可证。这将创建一个空的存储库。您可以将提交推送到该存储库。
答案 1 :(得分:0)
但是没有得到整个问题。 https://github.com/MYGITHUB/Vigenere.git
和 https://github.com/authentical/Vigenere
是不同的存储库。我不确定您是否尝试审查,否则可能是原因。