Re: move directories in work dir
- From
Junio C Hamano <junkio@cox.net>
- Date
- Oct 23, 2005, 06:24 UTC
- Message-ID
- <7vzmp04uot.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <6f22540448f7234336a00bce5b6547b6@Splinter>
"Rogelio M. Serrano Jr." <rogelio@smsglobal.net> writes:
> ... is there a way to tell git that i moved a directory into > another? For example i have.
Before you moved them, you could have done [*1*]:
$ mkdir analyze/import_tools $ git rename analyze/import_a analyze/import_tools/import_a $ git rename analyze/import_b analyze/import_tools/import_b
But that may be too late now. Instead you already did:
$ mkdir analyze/import_tools
$ mv analyze/import_a analyze/import_b analyze/import_tools/.At this point, you can:
$ git-add analyze/import_tools
$ git-ls-files analyze/import_a analyze/import_b |
git-update-index --remove --stdin> right now i have to do git-update-index --add for everything all over > again.
"git rename" is just a short-hand of your manual "git-update-index --add --remove" (and at the same time moving files in the working tree). There isn't any extra information you are giving git by using it (IOW "git" does not record renames).
BTW, do you really have a file whose name ends with an ESC character?
> analyse/import_a/import_a.c
[Footnote]
*1* It strikes me that git rename *could* be friendlier by emulating how "mv" treats the paths parameters (current implementation insists two parameters $src and $dst). What do you think, Ryan?