找到項目位置,打開終端輸入:
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 。