记录一次坎坷的git提交过程:Push rejected Push develop to origin/develop was rejected by remote

 找到项目位置,打开终端输入:

git pull
git pull origin develop
git pull origin develop --allow-unrelated-histories

然后回到idea里重新提交。我就是在这里出问题了

看下9:Version Control,如果你和我一样,说明已经提交过了,不过此时git中并没有我提交的代码。

记录一次坎坷的git提交过程:Push rejected Push develop to origin/develop was rejected by remote_第1张图片

不要点击git->commit directory,因为已经commit过了,此时会出现下图

记录一次坎坷的git提交过程:Push rejected Push develop to origin/develop was rejected by remote_第2张图片

正确方法是此时重新pull再提交一遍:右键项目,git->repository->pull,之后再git->repository->push 。

你可能感兴趣的:(实际开发问题总结)