LoginSignup
92

More than 5 years have passed since last update.

posted at

updated at

submodule の向き先 url を変更する

  • .gitmodules の向き先を新しい url に書き換える
[submodule "lib/hoge"]
        path = lib/hoge
-       url = git@github.com:8mamo10/old.git
+       url = git@github.com:8mamo10/new.git

  • この段階で .git/config を確認すると、まだ向き先が古いまま
[submodule "lib/hoge"]
        url = git@github.com:8mamo10/old.git
  • sync コマンドを叩く
$ git submodule sync
Synchronizing submodule url for 'lib/hoge'
  • .git/config の向き先が更新される
[submodule "lib/hoge"]
        url = git@github.com:8mamo10/new.git
  • 動作確認がてら submodule update でもしてみると、変更後の url から fetch してくれるはず
git submodule update

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
92