git pull
을 했더니 다음과 같은 에러가 나왔다.
error: Your local changes to the following files would be overwritten by merge: apps/home/insert.py
Please commit your changes or stash them before you merge.
Aborting
- 원인
문제의 원인은 원격 저장소에서 pull 할때 로컬에 수정한 파일이 존재하기 때문이다.
예를 들어 팀 프로젝트 파일을 pull 하는 것을 까먹고, 로컬에서 프로젝트 파일을 수정하던 중 원격 저장소 파일을 pull 하게 되면 이런 에러가 나타난다.
- 해결방법
1. 로컬 내 수정 사항을 임시 공간으로 옮긴다
git stash
2. 원격 저장소를 pull 한다.
git pull origin main
끄아아앙
'Dev > CS' 카테고리의 다른 글
[Git] git branch --set-upstream-to 에러 (0) | 2024.07.10 |
---|---|
fatal: not a git repository (or any of the parent directories): .git (1) | 2024.01.04 |
댓글