새로운 파일이 추가되면 git status를 누르면 빨간색으로 파일이 언급된다.
git add를 진행하면 git status에서 초록색 파일로 언급된다.
git commit을 진행하고 git status에서는 nothing이라고 뜬다.
git add 후 commit하기전에 stash를 이용하면 저장이 진행되는데 그냥
git stash pop
를 할때랑git stash apply stashList이름
은 서로 다른부분은
git stash pop
은 stash list가 없어지고
git stash apply stashList이름
은 stash list가 진행해도 남아있다.
git stash를 하기전에 초록색 상태로 add되어야한다.
- git init
- touch README
- git commit -m "init"
- git status : commit한 상태이므로 아무것도 없다.
- touch new_file
- git status : 새로운 new_file 빨간색 존재
- git add new_file : add로 추가
- git status : 초록색으로 존재
- git stash : stash 명령어 실행
- git stash list : 해당 stash가 존재
1.git stash pop : 다시 복귀
2. git stash list : stash 내용은 없어진다.
3. git status : add 상태로 유지된 파일들 존재
- git stash list : stash존재
- git stash apply stash@{0} : pop과 유사하게 복구
- git stash list : pop과 다르게 stash가 복구해도 존재
- git status : 복구한 new_file