-
Notifications
You must be signed in to change notification settings - Fork 2k
Inconsistency: Git restore is only used once, rest of book uses reset HEAD #1487
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
Comments
Sadly we're in a pickle here.
On the other hand, it's confusing and confidence-shaking when the output we show in the book is a mismatch with what a user sees when they type in the commands. A user with an up-to-date Git will see the So how do we cut this Gordian knot? I still think the right answer is to talk mostly about |
This kind of mirrors the problem with
I made a list of Git versions here: #1441 (comment) many operating systems would not have the
Yeah it's best if output from the book matches the terminal output, to prevent confusion and loss of confidence, I agree. The advice Git gives you is actually quite helpful here, so I think most users who bother to read the terminal output fully would probably be able to use
I also thought there are some use cases not yet covered by
This would also be a good way to handle this! I would then suggest that the new |
@ben Do you want a pull request for this then?
|
Sure! |
Will do. |
Uh oh!
There was an error while loading. Please reload this page.
Which version of the book is affected?
Problem is with the source files, present on current
master
.Describe the bug:
Inconsistency in the way to unstage a staged file.
Our examples use use
git reset HEAD <file to unstage>
.The status output we show is using
git reset HEAD
, as that is Git's prior advice before thegit restore
command became a thing.There's one place where the book uses
git restore
and it's introduced with commit: dc15a30Steps to reproduce:
git reset HEAD
in the book, notice it's used everywhere forgit status
and unstaging examples the book uses.git restore
, notice it's only used once.Expected behavior:
I expect the book to present a single way to unstage, and be consistent with it, so that readers are never confused.
Options to fix this:
git restore
can be used instead ofgit reset HEAD
.git restore
command, and put a note up in a appropriate place with something to the effect of: "Ifgit restore
doesn't work for you, trygit reset HEAD
.I'll wait for the maintainers feedback before making a pull request to fix it in one of the three ways listed.
Context:
This kind of issue also crops up with: #1441
The text was updated successfully, but these errors were encountered: