자바칩

[Git] git pull 에러 날 때, git stash로 안전하게 피하는 법 본문

Study/Command

[Git] git pull 에러 날 때, git stash로 안전하게 피하는 법

아기제이 2025. 10. 24. 15:57
728x90

1. 모든 변경사항 안전하게 백업(stash)하기

 - 작업 중인 수정·삭제·새로 추가된 파일까지 모두 안전하게 임시 저장

 - 여기서 -u (--include-untracked) 옵션은 Untracked 파일도 같이 저장

git stash push -u -m "임시 백업: 모든 변경사항 포함"

 

2. 원격 변경사항 가져오기

git pull

 

3. 백업된 변경사항 복구하기

git stash pop

 

4. 저장된 stash 목록 확인

git stash list