From: Zabre <427@free.fr>
To: git@vger.kernel.org
Subject: Re: (beginner) git rm
Date: Wed, 28 Jan 2009 04:00:45 -0800 (PST) [thread overview]
Message-ID: <1233144045221-2231849.post@n2.nabble.com> (raw)
In-Reply-To: <49804385.908@dbservice.com>
Tomas Carnecky wrote:
>
> Do you mean 'undelete' a file? git checkout d.txt - That restores the
> file in the working tree and resets the index just for that file.
>
Hi Tom,
(thank you for your interest in my newbie problems)
yes that's what I mean : 'undelete' a file, after a "git rm d.txt".
But I did not manage to apply your solution succesfully :
$ git rm d.txt
$ ls
a.txt b.txt c.txt
$ git status
# On branch new
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: d.txt
#
$ git checkout d.txt
error: pathspec 'mamma.txt' did not match any file(s) known to git.
Did you forget to 'git add'?
So it did not work but I've just noticed that unstage tip given by the
status command, and I did the following (which worked)
$ git reset HEAD d.txt
d.txt: needs update
$ ls
a.txt b.txt c.txt
$ git checkout d.txt
$ ls
a.txt b.txt c.txt d.txt
Reading the git reset help file gives me the feeling I should use this with
caution... It looks like you can somehow modify the change history.
Anyway these two commands helped me change the index the way I wanted.
Please tell me if this might somehow go wrong in another situation.
--
View this message in context: http://n2.nabble.com/%28beginner%29-git-rm-tp2231416p2231849.html
Sent from the git mailing list archive at Nabble.com.
next prev parent reply other threads:[~2009-01-28 12:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-28 10:11 (beginner) git rm Zabre
2009-01-28 10:36 ` Peter Krefting
2009-01-28 11:05 ` Zabre
2009-01-28 11:37 ` Tomas Carnecky
2009-01-28 12:00 ` Zabre [this message]
2009-01-28 12:19 ` Tomas Carnecky
2009-01-28 13:03 ` Theodore Tso
2009-01-28 18:25 ` Zabre
2009-01-28 18:23 ` Zabre
2009-01-28 20:17 ` Björn Steinbrink
2009-01-28 20:42 ` Zabre
2009-01-28 21:05 ` Zabre
2009-01-28 21:29 ` Junio C Hamano
2009-01-28 22:13 ` Björn Steinbrink
2009-01-28 22:33 ` Junio C Hamano
[not found] ` <6bef44ba0901281711m2d05e70fj4dd3ae03d7fe1052@mail.gmail.com>
2009-01-29 2:34 ` Björn Steinbrink
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=1233144045221-2231849.post@n2.nabble.com \
--to=427@free.fr \
--cc=git@vger.kernel.org \
/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).