Help us understand the problem. What is going on with this article?

submodule の向き先 url を変更する

More than 5 years have passed since last update.
  • .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
8mamo10
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away