更新.gitmodules的子模块仓库地址,但是没有生效,需要运行命令

当你更新了 .gitmodules 文件中的子模块仓库地址后,为了使这些更改生效并同步到实际的子模块目录,你需要执行以下步骤:

  1. 同步.gitmodules的更改
    使用 git submodule sync 命令来同步.gitmodules文件中的URL修改到你的本地配置。执行:

    git submodule sync
    
  2. 初始化子模块
    如果这是一个新添加的子模块,你需要使用 git submodule init 来初始化子模块配置。执行:

    git submodule init
    
  3. 更新子模块
    使用 git submodule update 命令会拉取子模块的内容,并检出到在.gitmodules中指定的提交或分支。执行:

    git submodule update --init --recursive
    

    其中 --init 选项会初始化每个子模块的本地配置文件,而 --recursive 选项表示递归地更新子模块中嵌套的子模块。

  4. 检查子模块状态
    之后,你可以使用 git submodule status 命令来检查子模块状态。这可以帮助你确认模块是否已更新。

请注意,这些命令将会根据你更新的仓库地址拉取子模块中的内容。如果子模块仓库要求认证(例如需要用户名和密码),你可能需要手动输入这些信息。

在执行上述命令后,子模块应该会使用新的仓库地址。如果你在其他机器或者团队成员中也使用了这个仓库,确保他们也知道需要同步这些变更。通常,你需要将 .gitmodules 文件的更改提交到版本控制系统中,以便其他人可以从版本控制系统进行同步。

git add .gitmodules
git commit -m "Update submodule URLs"
git push

以上操作将更改提交到你的远程仓库,这样其他使用该仓库的开发者也能通过拉取改动来同步子模块地址。

由于我在autodl租的服务器无法访问gitlab,我已经将eigen拉到了本地,如何使lietorch访问我本地的eigen文件夹,而不访问gitlab,报错如下:(mast3r-slam) root@autodl-container-cc3746a64c-4c1769bd:~/MASt3R-SLAM# pip install --no-build-isolation -e . Looking in indexes: http://mirrors.aliyun.com/pypi/simple Obtaining file:///root/MASt3R-SLAM Checking if build backend supports build_editable ... done Preparing editable metadata (pyproject.toml) ... done Collecting lietorch@ git+https://github.com/princeton-vl/lietorch.git (from MAST3R-SLAM==0.0.1) Cloning https://github.com/princeton-vl/lietorch.git to /tmp/pip-install-f0x_dt_2/lietorch_04351692bdf34ddb927c576984b5b361 Running command git clone --filter=blob:none --quiet https://github.com/princeton-vl/lietorch.git /tmp/pip-install-f0x_dt_2/lietorch_04351692bdf34ddb927c576984b5b361 Resolved https://github.com/princeton-vl/lietorch.git to commit 0fa9ce8ffca86d985eca9e189a99690d6f3d4df6 Running command git submodule update --init --recursive -q fatal: unable to access 'https://gitlab.com/libeigen/eigen.git/': The requested URL returned error: 503 fatal: clone of 'https://gitlab.com/libeigen/eigen.git' into submodule path '/tmp/pip-install-f0x_dt_2/lietorch_04351692bdf34ddb927c576984b5b361/eigen' failed Failed to clone 'eigen'. Retry scheduled fatal: unable to access 'https://gitlab.com/libeigen/eigen.git/': The requested URL returned error: 503 fatal: clone of 'https://gitlab.com/libeigen/eigen.git' into submodule path '/tmp/pip-install-f0x_dt_2/lietorch_04351692bdf34ddb927c576984b5b361/eigen' failed Failed to clone 'eigen' a second time, aborting error: subprocess-exited-with-error × git submodule update --init --recursive -q did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × git submodule update --init --recursive -q did not run successfully. │ exit code: 1 ╰─> See above for output.
最新发布
03-31
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值