All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Tim Visher" <tim.visher@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Is it possible to roll back unstaged changes while leaving the staged ones for the next commit?
Date: Wed, 17 Dec 2008 14:59:22 -0800	[thread overview]
Message-ID: <7vbpvajtmd.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <c115fd3c0812171448o3db6f4c1oc24e39f9a68ed1d3@mail.gmail.com> (Tim Visher's message of "Wed, 17 Dec 2008 17:48:50 -0500")

"Tim Visher" <tim.visher@gmail.com> writes:

> On Wed, Dec 17, 2008 at 3:30 PM, Junio C Hamano <gitster@pobox.com> wrote:
> ...
>>  (1) if you want to get rid of garbage changes in your work tree, you
>>     would want "git checkout $that_path";
>>
>>  (2) if you want to temporarily stash away further changes in your work
>>     tree, because you would want to first test what is staged, commit it,
>>     and then later continue to refine the changes stashed away thusly,
>>     you would want "git stash --keep-index".
> ...
> Unfortunately I couldn't figure out how to do this.  The solution I
> came up with was to go ahead and `git commit` the staged changes and
> then `git checkout PATH` the just committed file to overwrite the
> local edits with the version of the file I wanted.

How about omitting the "git commit" and do "git checkout PATH" after you
are done with the staging?  IOW, (1) above.

  reply	other threads:[~2008-12-17 23:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-17 19:57 Is it possible to roll back unstaged changes while leaving the staged ones for the next commit? Tim Visher
2008-12-17 20:30 ` Junio C Hamano
2008-12-17 22:48   ` Tim Visher
2008-12-17 22:59     ` Junio C Hamano [this message]
2008-12-18  1:22       ` Tim Visher
2008-12-18  3:34         ` Nanako Shiraishi
2008-12-18 12:24           ` Tim Visher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vbpvajtmd.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=tim.visher@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.