I have to automate cloning a repository and fetching it's all submodules. The urls for repository submodules are specified at .gitmodules
. If I were to go with defaults I would just do
git clone --recursive https://username:password@url.git
The problem is credentials aren't included in .gitmodules
file and I am prompted for those when I clone. I have to use HTTPS rather then SSH.
I tried to submit the credentials using git config:
git clone https://username:password@url.git my_repo
cd my_repo
git submodule init
git config submodule.my_submodule.url "https://username:password@url/my_submodule.git"
git submodule update
but I get prompted for credentials in the last update step. I've checked that the submodule url is correct and has proper credentials in .git/config
file.