1

What I want

I have an open source parent repository which I want to make a fork to work with it, this repository is composed of 3 submodules and some configuration files. What I want is to replace one of the submodules(saleor-storefront) with my own implementation(private repository) and I want to be able to update the other submodules and files with the changes made by the upstream repository.

Should I just change the path of the module I want to replace from the .gitmodules file or are there other changes involved that I'm not aware of?

Forked Project structure

saleor-platform
├── ./.gitmodules
├── ./common.env
├── ./docker-compose.yml
├── ./saleor
├── ./saleor-dashboard
└── ./saleor-storefront  -> Submodule to be replaced with my own implementation

.gitmodules

[submodule "saleor"]
    path = saleor
    url = https://github.com/mirumee/saleor.git
[submodule "saleor-storefront"]
    path = saleor-storefront
    url = https://github.com/mirumee/saleor-storefront.git
[submodule "saleor-dashboard"]
    path = saleor-dashboard
    url = https://github.com/mirumee/saleor-dashboard.git
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Cristian Flórez
  • 2,277
  • 5
  • 29
  • 51

1 Answers1

2

The Git 2.25 command git submodule set-url should help in order to update/replace the URL of one of your submodule by the one of your fork:

git submodule set-url -- saleor-storefront https://github.com/<me>/saleor-storefront

That way, you won't miss any "other changes" involved when modifying the URL of a submodule.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250