error: Cannot pull with rebase: Your index contains uncommitted changes.

수정한 코드를 git에 push 하기 전에 저장소에 있는 코드와 합치고 올릴 때,

git push –rebase 를 사용한다. 그러나 아래와 같은 에러가 발생했다.

 

error: Cannot pull with rebase: Your index contains uncommitted changes.

 

원인은 마지막 커밋 이후에 커밋하지 않은 작업물이 남아 있어서 rebase 에러가 발생했다. 따라서, statsh 를 해서 커밋하지 않은 작업물을 잠깐 치워두게 하면 된다.

참고: documentation

 

  • 해결
git pull --rebase --autostash

 

Leave a comment