【发布时间】:2019-12-11 15:44:24
【问题描述】:
在将本地 git 存储库推送到清空远程存储库时出现以下错误。这是一个私人仓库。
$ git push origin master 致https://bitbucket.org/lord_of_codes/uat_api.git ! [拒绝] master -> master(非快进) 错误:未能将一些参考推送到“https://lord_of_codes@bitbucket.org/lord_of_codes/uat_api.git” 提示:更新被拒绝,因为您当前分支的尖端落后 提示:它的远程对应物。集成远程更改(例如 提示:'git pull ...') 在再次推动之前。 提示:有关详细信息,请参阅“git push --help”中的“关于快进的说明”。
我刚刚在 bit bucket 上创建了一个空的 git repo。
我在本地项目中做了git init
我做了git add .
我首先承诺git commit -m "Initial Commit"
我做了git config --global user.namegit config --global user.email
我做了git remote add origin url
我做了git push origin master
然后我得到了那个错误。
我也试过在提交前推送代码,也试过git pull。但它不起作用
【问题讨论】:
-
stackoverflow.com/a/51997262/7254873 告诉我是否有帮助。