• JackbyDev@programming.dev
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    edit-2
    1 month ago

    “discard” is not a git operation. Reset and restore are, but those weren’t the words used.

    • zalgotext
      link
      fedilink
      arrow-up
      3
      arrow-down
      3
      ·
      1 month ago

      I’m not claiming that “discard” is a git action. I’m claiming a git user should understand what’s meant by the phrase “discard changes”. Run git status in a repo that has changes in the working directory. In the resulting output, there’s a message:

      Changes not staged for commit:
          (use "git add <file>..." to update what will be committed) 
          (use "git restore <file>..." to discard changes in working directory)
              ...
      

      The phrase “discard changes” is used consistently in git’s output.