Skip to content

Conversation

HonkingGoose
Copy link
Contributor

@HonkingGoose HonkingGoose commented Aug 29, 2020

Changes

  • Create section on git restore

Context

Fixes #1487 as we now have a section explaining what git restore is.
Read #1487 for the discussion we had leading up to this pull request.

This issue is also related: #1441 but I'm not closing it with this pull, because that issue also talks about the git switch command, which this pull request does not add.

This is a rough draft, that basically copies the two undo sections that used git reset and replaced the examples with git restore.

I'm of course open to your feedback to improve the text. You always have great suggestions! 😄 👍


Some questions/thoughts:

Should we perhaps change the example a bit more, so that we have less of a deja-vu experience? Or would that confuse readers even more?

I feel what I have now is quite heavy, and duplicates a lot of stuff.

And maybe rewrite this sentence, I really don't like this, it's a bit too complicated to understand at first read:

The nice part is that the command you use to determine the state of those two areas also reminds you how to undo changes to them.

It's a lot of words to basically say: git status is your friend and gives you helpful advice on how to undo stuff. 😸

@HonkingGoose
Copy link
Contributor Author

Hi @ben, this is ready for review. It's still a draft, and too rough to merge yet. I'll mark it ready for review after fixing it with your feedback. 😄 😉

@ben
Copy link
Member

ben commented Sep 11, 2020

Yeah, this looks great!

Warn readers not to throw away their local work without meaning to.
This is basically a copy/paste and adaptation of the warning we give about `git checkout -- <file>`.
@HonkingGoose HonkingGoose marked this pull request as ready for review September 12, 2020 08:06
@HonkingGoose
Copy link
Contributor Author

Changes:

  • Squash already approved changes into one commit and rebase on top of current master.
  • Add warning about git restore --staged <file> throwing away your local work.

@ben
Copy link
Member

ben commented Sep 25, 2020

@ben ben merged commit 51435bc into progit:master Sep 25, 2020
@HonkingGoose HonkingGoose deleted the create-section-git-restore branch September 25, 2020 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistency: Git restore is only used once, rest of book uses reset HEAD
2 participants