From: Matthieu Moy <Matthieu.Moy@imag.fr>
To: David Kastrup <dak@gnu.org>
Cc: git@vger.kernel.org
Subject: Re: How to stage a tree with all changes?
Date: Wed, 13 Jun 2007 18:47:56 +0200 [thread overview]
Message-ID: <vpqy7inajib.fsf@bauges.imag.fr> (raw)
In-Reply-To: <861wgf964g.fsf@lola.quinscape.zz> (David Kastrup's message of "Wed\, 13 Jun 2007 18\:22\:23 +0200")
David Kastrup <dak@gnu.org> writes:
> Suppose I have a number of changes in a tree: additions, deletions,
> renames and so on.
At commit time, a rename is just an add+delete for git. It'll
investigate renames with heuristics later, when needed.
> How do I stage and commit all of that?
Well, what I usually do is
$ git status
(nicer with
[status]
color = auto
in ~/.gitconfig)
and then "confirm" one by one the things I actually want to commit.
> git-commit -a
>
> omits new files.
>
> git-add .
> git-commit -a
The -a is not necessary if you just did "git add .".
> seemingly overlooks deletions.
In most cases, you'd have deleted the files with "rm", and you could
have told git at that time, using "git rm" instead. Otherwise,
$ git-ls-files -z | git-update-index --remove -z --stdin
will remove deleted files from the index after the fact. But I don't
know any porcelain command to do that. Perhaps a "git rm -u" could be
a nice dual for "git add -u"?
--
Matthieu
next prev parent reply other threads:[~2007-06-13 16:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-13 16:22 How to stage a tree with all changes? David Kastrup
2007-06-13 16:47 ` Matthieu Moy [this message]
2007-06-13 18:40 ` 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=vpqy7inajib.fsf@bauges.imag.fr \
--to=matthieu.moy@imag.fr \
--cc=dak@gnu.org \
--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).