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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With