
1. Git Stash란?
A라는 brach에서 작업을 하던 도중에, commit을 하지 않고 다른 branch로 이동을 할 수 없습니다.
-> 이때, commit을 하고 싶지는 않는데, 다른 branch로 이동할 수 있습니다.
-> 임시 저장
과 같은 개념
2. Git Stash
>git stash
or >git stash save
commit되지 않은 모든 변경사항을 stash
>git stash pop
가장 최근에 stash한 변경사항을 꺼내올 수 있음
>git stash apply
가장 최근에 stash한 변경사항을 꺼내오는데, stash영역에 stash한 내용은 남겨둡니다.
여러 개 Stash 사용하기
- stash 영역은 stack 구조로 작동해서, 여러개를 stash할 수 있습니다.
(많이 사용하는 기능은 아닙니다.)
>git stash
로 여러개 push해줍니다.
>git stash list
stash된 목록을 보여줍니다.
>git stash apply stash@{id}
stash 목록의 해당 id의 stash를 가져옵니다. (stash영역에 stash한 내용은 남겨둡니다.)
>git stash drop stash@{id}
stash 목록의 해당 id의 stash를 제거합니다.


C
Contents