git init
git remote add origin git@git.coding.net:xxx/xxxxxxxxx.git
git add . git commit -m "fisrt commit"
git push -u origin master
$ git push -u origin master To https://e.coding.net/zyh/xxxxxxxxxxxxxxxxxxxx.git ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://e.coding.net/zyh/xxxxxxxxxxxxxxxxxxxx.git' hint: Updates were rejected because the remote contains work that you do 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.
错误信息:
To https://e.coding.net/zyh/xxxxxxxxxxxxxxxxxxxx.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://e.coding.net/zyh/xxxxxxxxxxxxxxxxxxxx.git'
hint: Updates were rejected because the remote contains work that you do
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.
问题原因:
远程库与本地库不一致造成的,在hint中也有提示把远程库同步到本地库就可以了。
执行如下命令即可
git pull --rebase origin master
上一篇: 《建站管家》二次开发文档
下一篇: python模拟header报错:AttributeError: 'set' object has no attribute 'items'