logo Mr.Robota 具身智能学习手册 中文
Chapter 11: Other auxiliary tools

If you don’t want to modify the configuration file manually, you can directly run this global configuration command. It tells Git: Whenever it encounters a git@github.com: address, it will automatically replace it with https://github.com/.

Run in the terminal:

Bash

git config --global url."https://github.com/".insteadOf git@github.com:

After running the above command, the update command to try again:

Bash

git submodule update --init --recursive

Note: If the sub-module is a private repo, Git will prompt for the GitHub username and password (the current password usually refers to a Personal Access Token). If it is a public repo, it will be downloaded directly.


Method 2: Manually modify the .gitmodules file

If you want to permanently modify the configuration of this project, you can edit the .gitmodules file in the root directory of the project.

  1. Edit the file:

Open .gitmodules using vim or nano:

Bash

vim .gitmodules
  1. Modify the URL:

    Find the section [submodule “policy”], and change the url from SSH format to HTTPS format.

    Before modification:

    Ini, TOML

    url = git@github.com:shuosha/policy_training.git
    

    Modified:

    Ini, TOML

    url = https://github.com/shuosha/policy_training.git
    
  2. Synchronize and update (key step):

After modifying the file, you must run sync for Git to recognize the new URL, and then update it:

Bash

git submodule sync
git submodule update --init --recursive

Method 3: Only modify the local git configuration (does not affect files)

If you don’t want to modify the .gitmodules file in the code (to avoid affecting others when submitting), you can only modify the .git/config file.

  1. Open the .git/config file:

    Bash

    vim .git/config
    
  2. Find the [submodule "policy"] section and replace url with https://github.com/shuosha/policy_training.git.

  3. Save and exit, then run the update command directly.

Summary Recommendations

Since it is in the root@gpufree-container environment, I recommend using Method 1 directly. It does not require modifying files through an editor, and it can immediately solve similar issues of all submodules.

Next step:

You can directly copy and run this command, then try the update again:

Bash

git config --global url."https://github.com/".insteadOf git@github.com: && git submodule update --init --recursive