1

I`ve forked a repository which contains one submodule, I cloned the repo and its submodule to my laptop and made some changes to the source code and the submodule and pushed them to my repository.

after checking my repository, I noticed that changes I made to the submodule, didn`t pushed.

How can I fix this?

Yashar
  • 2,095
  • 3
  • 22
  • 29

1 Answers1

1

First, forking the repo doesn't fork the submodule: make sure you have the right to push to that submodule repo.
And making changes to a submodule means you need to push to the submodule upstream repo from within said submodule.

cd /path/to/repo/submodule
# changes
git add .
git commit -m "Changes to submodule"
git push

And then you need to add the new gitlink to the index of the parent repo:

cd ..
git add .
git commit -m "Record new submodule state"
git push
Community
  • 1
  • 1
VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755