我使用git通过https克隆一个repo因此:
git clone https://username:password@alocation/git/repo.git
Run Code Online (Sandbox Code Playgroud)
这很好,但它有大量的子目录要克隆,所以我使用该--recursive选项.
这里的问题是,对于顶级,它需要指定用户名和密码,但是对于每个子仓库,它再次询问详细信息,因此我得到以下内容:
C:>git clone --recursive https://username:password@alocation/git/repo.git
Cloning into repo...
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 15 (delta 8), reused 0 (delta 0)
Unpacking objects: 100% (15/15), done.
Submodule 'sub1' (https://alocation/git/repo.sub1) registered for path 'sub1'
Submodule 'sub2' (https://alocation/git/repo.sub2) registered for path 'sub2'
Submodule 'sub3' (https://alocation/git/repo.sub3) registered for path 'sub3'
Submodule 'sub4' (https://alocation/git/repo.sub4) registered for path 'sub4'
Cloning into sub1...
Username:
Password:
remote: Counting objects: 10, done.
remote: Compressing …Run Code Online (Sandbox Code Playgroud)