通过webstorm的git工具提交代码带GitHub,结果在push的时候报错:

21:32:03.993: [Frontend] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -f -- src/components/Editor/components/DataProcess.vue src/store/modules/graph.js src/config/graph/modelRectNode.js src/config/graph/customEdge.js src/config/api/graph.js src/components/Editor/editor.vue src/components/Editor/components/Operation.vue src/config/behavior/add-edge.js src/components/Editor/components/Header.vue src/components/Editor/components/Editor.vue src/store/getters.js
21:32:06.521: [Frontend] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false commit -F C:\Users\ALEX00~1\AppData\Local\Temp\git-commit-msg-.txt --
[Alex 41966ac] 2020-11-29
 11 files changed, 417 insertions(+), 118 deletions(-)
 create mode 100644 src/components/Editor/components/Operation.vue
 create mode 100644 src/config/api/graph.js
 create mode 100644 src/config/graph/customEdge.js
21:32:18.197: [Frontend] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/Alex:Alex --tags
error: failed to push some refs to 'https://github.com/Matrix-King-Studio/MatrixAILab/'
hint: Updates were rejected because the remote contains work that you do
To https://github.com/Matrix-King-Studio/MatrixAILab/
!	refs/heads/Alex:refs/heads/Alex	[rejected] (fetch first)
hint: not have locally. This is usually caused by another repository pushing
Done
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.

查了些资料,说是在不同的机器上做了提交,远程分支上存在本地分支不存在的提交,可以先fetch在merge,也就是pull,把远程分支上的提交合并到本地分支之后再push。

如果确定远程分支上的提交都不需要了,可以直接git push origin master -f强制让本地分支覆盖远程分支。
在这里插入图片描述

Logo

前往低代码交流专区

更多推荐