git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: knittl <knittl89@googlemail.com>
To: Jeenu V <jeenuv@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Git reset -p on working tree
Date: Tue, 23 Nov 2010 11:58:46 +0100	[thread overview]
Message-ID: <AANLkTi=5w3YpYu0_WbmHud0BUkO2BqYNVezWDMkCaSj2@mail.gmail.com> (raw)
In-Reply-To: <AANLkTindHnjeXEGbKWiQkWgoUBwqZbdx71sQwNr_gFp0@mail.gmail.com>

On Tue, Nov 23, 2010 at 11:32 AM, Jeenu V <jeenuv@gmail.com> wrote:
> On Tue, Nov 23, 2010 at 3:56 PM, Jeenu V <jeenuv@gmail.com> wrote:
>> On Tue, Nov 23, 2010 at 2:50 PM, knittl <knittl89@googlemail.com> wrote:
>>>> Right now I do this with vimdiff, by applying 'git diff' in reverse.
>>>> Wish reset supports -p on working tree operations as well because the
>>>> -p framework (of add, and reset) feels good to use.
>>>
>>>
>>> there's `git checkout -p` to selectively remove changes from your working tree.
>>> (also `git stash -p` to selectively stash changes temporarily)
>>
>> Surprised to know that checkout and stash supports it! Thanks a lot
>> for pointing out.
>
> I think Git could suggest 'checkout -p' and/or 'stash -p' when user
> tries to use -p with --{hard,soft,mixed} with reset command (in
> addition to mentioning that they're incompatible), since relatively
> new users are used to 'reset' than other commands to reset their
> working trees.

`git reset` seldomly affects the working tree, unless using `--hard`,
`--merge` or `--keep`, and those switches are potentially dangerous if
you are not aware of the implications to your worktree and index.

without options reset undoes a previous add, i.e. remove changes from
the index, but not the working tree.

git reset manpage mentions git-checkout:

> After running git reset <paths> to update the index entry, you can
> use git-checkout(1) to check the contents out of the index to the
> working tree. Alternatively, using git-checkout(1) and specifying a
> commit, you can copy the contents of a path out of a commit to the
> index and to the working tree in one go.


--
typed with http://neo-layout.org
myFtPhp -- visit http://myftphp.sf.net -- v. 0.4.7 released!

  reply	other threads:[~2010-11-23 10:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23  9:11 Git reset -p on working tree Jeenu V
2010-11-23  9:20 ` knittl
2010-11-23 10:26   ` Jeenu V
2010-11-23 10:32     ` Jeenu V
2010-11-23 10:58       ` knittl [this message]
2010-11-23 13:00         ` Jeenu V
2010-11-23 14:20           ` [PATCH] Hint at "checkout -p" in the "reset --patch <type>" error message Štěpán Němec
2010-11-23 14:59             ` Jeff King
2010-11-23 15:23               ` Štěpán Němec
2010-11-25  8:55                 ` Michael J Gruber
2010-11-25 10:56                   ` Jakub Narebski
2010-11-25 13:10                     ` Michael J Gruber
2010-11-25 15:56                   ` Matthieu Moy
2010-11-25 16:14                     ` Jeff King

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='AANLkTi=5w3YpYu0_WbmHud0BUkO2BqYNVezWDMkCaSj2@mail.gmail.com' \
    --to=knittl89@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=jeenuv@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).