问题是什么?公钥已配置。
$ git push origin master
To https://github.com/merrymaker14/uploadca.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to https://github.com/merrymaker14/uploadca.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushin
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 push。git push --force 你的问题是因为有人对远程存储库进行了更改,你被迫将更新下载到自己 (git pull) 但是使用 top 命令 (git push --force) 我明确表示我不想克隆在远程存储库上更新的版本
原因也可能是文件仍在被另一个程序使用。如果你只是
我将添加历史记录,如果还没有什么可以推送的话,这可能会发生。使用干净的存储库,而不是第一次提交,尝试推送
新项目在gitlab上就出现了这样的问题。我这样解决了: 1. 在站点本身的 master 中创建了一个自述文件 2. 做了一个 git 克隆 3. 创建了一个开发分支 4. 将项目移动到当前存储库 5. 推送开发