Git
[Git] git pull 에러 "your local changes to the following files would be overwritten by merge"
cornarong
2021. 11. 16. 14:16
얼마 전 서버 내에서 java application.properties에 직접 접근하여 IP를 잠시 수정했다가 돌려놓았던 일이 있었는데
그로인해 수정사항이 생기는 바람에 .add 하지 않을 경우 실패되는 상황이 발생했다.
에러내용)
error: Your local changes to the following files would be overwritten by merge:
src/main/resources/application.properties
Please commit your changes or stash them before you merge.
번역내용은 아래와 같습니다.
오류: 다음 파일에 대한 로컬 변경 사항은 병합에 의해 덮어쓰여집니다.
src/main/resources/application.properties
변경 사항을 커밋하거나 병합하기 전에 보관하십시오.
사용한 방법 - git stash
(현재 디렉토리의 파일을 임시로 백업하고 깨끗한 상태로 돌린다. )
1. 현재 스테이지의 변경된 사항은 stack에 임시로 저장해두고
git stash
2. master에서 pull하거나, git checkout 등 원격 저장소에서 내 로컬 브랜치로 변경사항을 적용한다
git pull origin master
3. pull이 완료되면 다시 stack을 지운다
git stash pop
참고)
[Git (6)] git pull 에러 해결방법 (Your local changes to the following files would be overwritten by merge )
[Git (6)] git pull 에러 해결 (Your local changes to the following files would be overwritten by merge ) 안녕하세요. 갓대희 입니다. 이번 포스팅은 [ git pull 충돌 에러 해결방법 ] 입니다. : ) 1...
goddaehee.tistory.com