Re: move directories in work dir

From: Junio C Hamano <junkio@cox.net>
Date: 2005-10-23 16:24:34
"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?

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sun Oct 23 16:25:12 2005

This archive was generated by hypermail 2.1.8 : 2005-10-23 16:25:17 EST