본문 바로가기
Programming/Git

[Git] git stash (git 임시 저장)

by guru_k 2022. 5. 17.
728x90
반응형

git stash

git stash는 현재 진행중인 작업들을 commit 하지 않고 임시 저장 후 나중에 불러와서 다시 작업을 진행할 수 있도록 도와주는 명령어이다.

stash 임시 저장

git stash 명령어를 사용하여 stash에 저장되고 이때 작성중인 working directory는 이전상태로 돌아간다.

$ git stash
$ git stash save

stash 저장 목록 확인

$ git stash list
stash@{0}: WIP on refactor-code: fdc47a753 refactor code

stash 저장 가져오기

# 최근 stash 가져오기
$ git stash apply

# 특정 stash 가져오기 
$ git stash apply stash@{0}

stash 제거

# 최근 stash 제거
$ git stash drop

# 특정 stash 제거
$ git stash drop stash@{0}
728x90
반응형

댓글