Today I Run

[Git] Stash 알아보기

조핑구 2024. 5. 9. 10:17

브랜치를 이동할때 작업내용을 커밋하지 않으면 이동이 불가능하다. 하지만 커밋단위가 정해져있기 때문에 하나고치고 커밋하는건 불가능할때가 많다. 따라서 변경사항의 임시저장이 필요하다.

스태시는 stack 구조이다

명령어
git stash 변경내용 임시저장하기
git stash list stash했던 내용 보기
git stash apply 가장 최근 stash 가지고오기
git stash applt stash@{name} 특정 stash 가지고오기
git stash drop 가장 최근 stash 지우기
git stash drop stash@{name} 특정 stash 지우기
git stash clear 한번에 모든 stash 모두 지우기
git stash pop 가장 최근 stash를 적용하고 동시에 stack에서 지우기
git stach pop stash@{name} name stash를 적용하고 동시에 stack에서 지우기
git stash save {stashname} stash를 원하는 이름으로 정하기

'Today I Run' 카테고리의 다른 글

[SpringBoot] Swagger 설정  (0) 2024.05.09
[SpringBoot] JPQL  (0) 2024.05.09
[SpringBoot] jpa-ddl-auto  (0) 2024.05.08
[CS] 2의 보수  (0) 2024.05.08
[JAVA] String에서 +를 하면 안되는 이유  (0) 2024.05.08