[Git] git pull 충돌 에러 해결법 : git stash
git pull 했을 때 발생하는 overwritten by merge 해결하는 법 (로컬브랜치와 원격브랜치의 충돌) 1. 에러 발생 error: Your local changes to the following files would be overwritten by merge: .idea/codeStyles/Project.xml <- 이 파일 때문에 git pull 실패! 로컬에서 변경된 파일이 pull로 가져오려는 파일과 충돌이 나는 경우 보통 commit을 잘해주면 되지만, commit하면 안 되는 파일인 경우 난감하다. (또는 수정중이어서 commit을 못한 상태에서 다른 작업을 하는 경우) 이럴 때 사용할 수 있는 방법! 2. 해결 방법 1) git stash $ git stash git stash 는 local에서의 변경사항을 임시로 백업해서 working directory를 HEAD상태 (clean working directory)로 만들어준다. 따라서 git stash 를 사용하면 unstaged 변경사항이 있을 때 commit하지 않아도 현재의 상황을 stash에 임시로 백업해두고 git pull 을 할 수 있게 된다. 2) git pull $ git pull -> 현재 branch에 remote 되어있는 branch에서 Pull 해온다. 또는 $ git pull origin <branch name> -> origin에 연동된 원격저장소에서 특정 branch만 pull 해온다. 해주면 pull 이 성공적으로 된다!!🥳 3) git stash pop $ git stash pop 으로 저장된 stash를 다시 적용한다. git stash pop 은 stash에 저장한 내용을 working directory에 적용하고, stash에서 제거한다. ...