Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You cannot "opt out" of the index. It's always sitting there.

   $ ls -l .git/index
When it gets corrupt, though, you can blow it away. It gets rebuilt.

The reason it can be casually rebuilt is that there is a copy of it in the HEAD commit.

The git index is an intestinal appendix. It has no reason to exist.

There is no need to "stage" changes and then move them to a commit. What is called staging should just create a new commit.

The index creates duplicity. Many commands operate on both the work tree and index, or separately on either one.

Your working tree can differ from the index, which differs from the HEAD commit, so then you have "git diff" (tree to index), "git diff --cached" (index to HEAD) and "git diff HEAD" (tree to HEAD).

What's the point of staging a commit, when a commit can be amended? You need staging for something that cannot be easily fixed once it is deployed.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: