在本地代码 git init 之后在 gitee 上创建了仓库,然后直接 push 发现错误提示如下
hint: Updates were rejected because the remote contains work that you dohint: not have locally. This is usually caused by another repository pushinghint: to the same ref. You may want to first integrate the remote changes
翻译过来:
提示:更新被拒绝,因为远程包含您所做的工作
提示:没有本地。这通常是由另一个存储库推送引起的
提示:到相同的ref.你可能想先集成远程更改
解决办法:
先 git pull use rebase
然后再 push
原因应该是由于本地和远程仓库两者代码文件不同步,因此需要先pull,进行合并然后再进行push。