210203 Git Stash Practice

Git stash

Git Stash Practice

branch를 끊어서 작업을 하는데, 일부 작업한 내용을 잠시 stage에 올려서 다른 branch에서 작업을 하고자 할때 stash를 활용할 수 있다.

아직 파일의 수정이 끝나지 않아서 commit 하기가 곤란하고, revert로 인해 다른 branch로 checkout을 하기도 곤란한 상황을 처리할 때 git stash를 사용한다.

git stash 명령은 git add를 통해서 트래킹 중인 파일에 대해서만 사용이 가능하다.


새로운 stash 생성

1
2
3
4
# saved to `refs/stash`
$ git stash
or
$ git stash save

생성된 stash 리스트 확인

1
$ git stash list
Read more