Re: How to stage a tree with all changes?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Kastrup <dak@xxxxxxx> 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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux