記錄一次坎坷的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->commit directory,因爲已經commit過了,此時會出現下圖

正確方法是此時重新pull再提交一遍:右鍵項目,git->repository->pull,之後再git->repository->push 。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章