기타

[Git] stash 정리

jhlee_ 2022. 9. 14. 12:49

stash 내용 보기

git stash list

stash한 사항을 꺼내옴

지우지 않고 적용함

git stash apply

stash한 내용을 지움

git stash drop

apply + drop

git stash pop

모든 stash상황 clear하기

git stash clear

특정 stash 가져오기

$ git stash list
stash@{0}: On develop: yarn 문제 해결을 위한 stash
stash@{1}: On develop: 9월8일 임시저장
stash@{2}: On develop: 9월2일 branch 변경을 위한 임시저장
...

git stash apply stash@{1}
했을때

error: unknown switch `e'
usage: git stash apply [--index] [-q|--quiet] [<stash>]

    -q, --quiet           be quiet, only report errors
    --index               attempt to recreate the index

에러가 난다면

git stash apply 'stash@{1}'로 해결하기

728x90