|
|
|
|
|
by tednaleid
4765 days ago
|
|
The index isn't the information on all your files (it's not the .git directory). The index is an intermediate holding location between the file system and actually storing all of those files as a commit in the commit tree. It's the current state of the proposed next commit. Your description misses (or conflates) an entire tree of information (the HEAD tree), and it's arguably the most important one as it holds the whole of your git repo's history. I didn't fully understand git till I read Scott Chacon's "A Tale of 3 Trees" which explains what reset is all about and goes into the details: http://git-scm.com/blog/2011/07/11/reset.html I love git, but I do not think it's obvious or intuitive without some explanation. It's different than any other SCM I've used in the past. I created this presentation a while ago that I think highlights some of the real concepts that people need to know to really understand git: http://tednaleid.github.io/showoff-git-core-concepts/ |
|
You have repository meta data in your .git folder.
You can download new information into your .git folder using git fetch.
...but you can only apply changes to your .git folder's data locally (eg. git merge)
...and you can only apply changes to your file system from your local .git folder.
Four, basic concepts. Why is this difficult?
There's tonnes of complexity in git, sure, if you have trouble merging after a rebase, sure, that's totally understandable.
...but the basic failure to understand the difference between applying a remote change directly to your current file system (not possible) and downloading that change and then applying it locally in various ways frustrates me, I've got to say.