본문 바로가기

PROGRAMMING/GIT

[GIT] Staging Area / Index 의 존재이유

이전 포스트에 이어 Index라는 개념이 있는이유를 알아본다

우선 이 개념이 낮선이유는 내가 svn을 주로 사용하기 때문

 

계속 머릿속에 드는 의문

왜 commit 전 add를 해야되지

Staging Area가 뭐지

 

갓텍오버플로우

stackoverflow.com/questions/49228209/whats-the-use-of-the-staging-area-in-git

 

What's the use of the staging area in Git?

What is the point of git add . or git add to add it to the staging area? Why not just git commit -m "blabla"? I don't understand the value of the staging area.

stackoverflow.com

결론은

프로젝트에서 이것저것 작업햇는데

올리긴 애매하고 그렇다고 섞이면 나중에 분류하기 힘드니 중간에 올려놓으면

마지막에는 add된 작업들만 commit하면 된다는 이점이 있는 것 같다.

 

그러면 stage/ stage area / index 다 똑같은 말인가?

www.reddit.com/r/git/comments/2szztw/is_the_index_the_same_as_the_staging_area/

 

Is the "index" the same as the staging area?

The command `git add --help` says: > The "index" holds a snapshot of the content of the working tree, and it is this snapshot that is taken as...

www.reddit.com

정답은 YES