在上传代码时,显示无法上传
PS E:\JavaWeb\vue3-project> git push
To https://gitee.com/evening-breeze-2003/vue3.git! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/evening-breeze-2003/vue3.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
提示告诉我们文件版本冲突,我们使用 git pull 合并一下远程仓库的版本和本地的版本,git pull
如果 git pull 拉取失败,可能会提示你是哪些文件有问题,不能上传,或者有冲突
PS E:\JavaWeb\vue3-project> git pull
error: Pulling is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
我们根据提示,需要我们修改或者删除需要提交的某些文件
我们显示一下所有文件的状态:git status,可以看到 README.md 文件冲突了
我们将这两个文件的提交从 commit 之中删除
然后我们再次拉取,就可以发现拉取成功了
这次我们再进行 git push 操作就不会报错了
最后成功提交代码: