-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ambiguity in the arrow for reset in first diagram #64
Comments
Hi categulario! You seem to have some confusion around what the terms "stage" and "unstage" mean. Both have a target of the stage. To "stage" something is to set up the index to be exactly what will be committed upon next In other words, the following statements in your original post are incorrect:
Does that make sense? Since this is the first time someone has brought up this issue in nine years, I don't think this is a particularly common issue so I will leave the text as-is. |
I guess that is is unclear or misleading whether the three boxes are areas of the index (btw stage is incorrectly labeled as the index since HEAD is also contained in it) or states of the tree: working directory clean, changes (staged and/or unstaged). Also the arrows have sometimes the function of moving the boundaries inside the index (git commit) or moving data (git checkout). If the meaning of the arrows is moving data between areas within the index then the git reset is incorrectly placed as I suggest because git reset moves the boundary between the stage area and the unstaged area, and the HEAD (history) area remains untouched.
What is the content that gets copied from HEAD to the stage when unstaging? The only reason I care about this is because someone was using this as reference with the result of more confusion about what was happening. Making this clear would make this a much better resource! |
I'm not sure where you are getting your information, but the index is a synonym for the stage. The link you provided does not contradict that. (In fact, it doesn't even have the word "HEAD.") The arrows are always about moving data between three places: the history (i.e. commits), the stage / index, and the working directory. I don't understand what you mean by "moving boundaries."
The original content of the file. Here is a concrete example. First, create an initial repository and a handy alias for printing the contents of a given file in the three locations: history (HEAD), stage, and working directory.
Now let's set it up so that each has different contents.
Now, try staging a file via
And finally, try unstaging a file via
|
https://stackoverflow.com/questions/4084921/what-does-the-git-index-contain-exactly#4086986
that is why you're seing that output using that definition of your
perhaps you should be using this function instead. Effectively, if what you want is to show the state of the stage you should use that: https://stackoverflow.com/questions/1587846/how-do-i-show-the-changes-which-have-been-staged#1587877 which of course is going to be empty after commit. |
I'm sorry, I don't think there is anything more I can do to help you. |
In the diagram the command
git reset -- files
is pointing from the history towards the stage area:however in the description it is stated that:
so there are conflicting statements here:
The specified usage (
git reset -- files
) implies an arrow in the same direction asgit checkout
. Perhaps is worth mentioning thegit reset [--hard|--soft] tree-ish
variant that actually follows the arrow in the diagram.It relates to #20
The text was updated successfully, but these errors were encountered: