[Git] git pull 에러(error: Your local changes to the following files would be overwritten by merge)

송진영·2022년 4월 18일
0

Git

목록 보기
4/5

오류

error: Your local changes to the following files would be overwritten by merge

git pull을 할 때 위와 같이 오류가 발생하는 경우가 있다.

원인

이는 달라진 파일들과 git에서 가져오려는 파일들의 충돌 때문에 발생하는 오류이다.

해결

  1. git stash
    : staging 영역에 있는 파일의 변경사항을 스택에 넣어둔다.
~$ git stash
~$ git pull
  1. git add .
    : 달라진 파일들을 staging 영역에 저장하고 git pull을 하면 오류를 해결할 수 있다.
~$ git add .
~$ git pull
profile
못하는 건 없다. 단지 그만큼 노력을 안 할 뿐이다.

0개의 댓글