To https://gitee.com/pre-li/first-project.git ! [rejected] master -> master (fetch first)er

To https://gitee.com/pre-li/first-project.git ! [rejected] master -> master (fetch first)er_第1张图片

 To https://gitee.com/pre-li/first-project.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://gitee.com/pre-li/first-project.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.

git push -u origin master

产生原因:更新的文件和原来的文件不一样、有冲突

        我这边是仓库初始化了,有readme文件。但是更新的文件里面没有readme
解决办法:解决冲突

        要么用 git push -f origin master 命令以覆盖的方式进行更新,这样会带来版本覆盖的问题;

        要么删掉仓库里的readme文件或者在更新内容里面创建新的readme文件,解决两边的冲突问题。

你可能感兴趣的:(error,报错,git)