git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 5/6] git-reset.txt: point to git-checkout

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 14, 2010, 00:19 UTC
Message-ID
<7vlj759nyd.fsf@alter.siamese.dyndns.org>
In-Reply-To
<520620a60966ebdfa6e1fe8b407b0de51c302b82.1284365021.git.git@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 18 quoted lines
> for the case of updating a file in index and worktree.
>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---
>  Documentation/git-reset.txt |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
> index 60b4b80..40e2fd8 100644
> --- a/Documentation/git-reset.txt
> +++ b/Documentation/git-reset.txt
> @@ -27,6 +27,9 @@ in all forms.
>  This means that `git reset <paths>` is the opposite of `git add
>  <paths>`.
>  
> +If you want to reset index entry and working tree state of a file,
> +linkgit:git-checkout[1] is your friend.
> +
I am not quite sure if this is an improvement.

You can reset the index entry using git-reset and then check the path out of the index to the working tree using git-checkout, in two separate steps. You can alternatively stuff the contents out of a commit (or more in general any tree-ish) to the index and check it out to the working tree with a single git-checkout. It is obvious to _me_ that you meant to hint the latter in the above, but for people who need that hint it probably isn't. Can we make it clearer? Perhaps...

    Using linkgit:git-checkout[1], you can copy the contents of a path out
    of a commit to the index and to the working tree in one go.
Or if you meant the former, 
    After running "git reset <paths>" to update the index entry, you can
    use linkgit:git-checkout[1] to check the contents out of the index to
    the working tree.
Previous: Michael J GruberNext: Michael J Gruber
Message 11 of 22 in “git-reset.txt improvements”
  1. 0/6 git-reset.txt improvementsMichael J Gruber, Sep 13, 2010
  2. 1/6 git-reset.txt: clarify branch vs. branch headMichael J Gruber, Sep 13, 2010
  3. Junio C HamanoSep 14, 2010
  4. 2/6 git-reset.txt: reset does not change files in targetMichael J Gruber, Sep 13, 2010
  5. Junio C HamanoSep 14, 2010
  6. 3/6 git-reset.txt: reset --soft is not a no-opMichael J Gruber, Sep 13, 2010
  7. Jay SoffianSep 13, 2010
  8. Junio C HamanoSep 13, 2010
  9. 4/6 git-reset.txt: use "working tree" consistentlyMichael J Gruber, Sep 13, 2010
  10. 5/6 git-reset.txt: point to git-checkoutMichael J Gruber, Sep 13, 2010
  11. Junio C HamanoSep 14, 2010
  12. 6/6 git-reset.txt: make modes description more consistentMichael J Gruber, Sep 13, 2010
  13. Junio C HamanoSep 14, 2010
  14. Michael J GruberSep 15, 2010
  15. Jay SoffianSep 13, 2010
  16. 0/6 git-reset.txt improvementsMichael J Gruber, Sep 15, 2010
  17. 1/6 git-reset.txt: clarify branch vs. branch headMichael J Gruber, Sep 15, 2010
  18. 2/6 git-reset.txt: reset does not change files in targetMichael J Gruber, Sep 15, 2010
  19. 3/6 git-reset.txt: reset --soft is not a no-opMichael J Gruber, Sep 15, 2010
  20. 4/6 git-reset.txt: use "working tree" consistentlyMichael J Gruber, Sep 15, 2010
  21. 5/6 git-reset.txt: point to git-checkoutMichael J Gruber, Sep 15, 2010
  22. 6/6 git-reset.txt: make modes description more consistentMichael J Gruber, Sep 15, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.