Q:

copy/mv directory to another directory in git

I have a 
dir1/ contains a lot files and subdirecties, I want to change the directory name to dir2/ . I tried 

git mv dir1/ dir2/

I got this message:
fatal: renaming 'dir1' failed: Permission denied

update:
I ran from git for windows command line http://code.google.com/p/msysgit/
What is the correct command?

A:

It could also be that the directory (or a file within) is being used by another program, which prevents you from doing anything with that folder. Only on Windows, obviously.
Use the Process Explorer if you're unsure which program has captured that directory/file.

A:

You can just use standard unix tools, or whatever your OS is.  So:
mv dir1 dir2

should work.  Just make sure you add both dir1 and dir2 to the staging area after you've done that, so that you commit the changes.
An example of how to commit the change (once done) could be:
git add dir1 dir2 && git commit dir1 dir2

There's probably other ways to do it too.

