I am trying to clone a submodule for my drupal installation. I run the following command:
git submodule add http://git.drupal.org/project/token.git /sites/all/modules/token
This throws this error:
The following path is ignored by one of your .gitignore files:
/sites/all/modules/token
Use -f if you really want to add it.
But my .gitignore file is empty.
So开发者_StackOverflow I tried to run it as suggested:
submodule add -f http://git.drupal.org/project/token.git /sites/all/modules/token
But this throws this error:
fatal: could not create leading directories of '/sites/all/modules/token': Permission denied
Clone of 'http://git.drupal.org/project/token.git' into submodule path '/sites/all/modules/token' failed
Permissions are 777.
Ideas?
Regards Lukas
Just found the answer:
git submodule add http://git.drupal.org/project/token.git sites/all/modules/token
The leading "/" was the problem.
I had the same problem, but apparently for different reasons. I tried to use git submodule add
like I used git clone
- without specifying the directory like this:
git submodule add ../repos/subA
instead of git submodule add ../repos/subA subA
All I have to say is that is the effing worst error message possible to tell me I left off a required command-line argument.
精彩评论