I’m quite new to this Git thing and need a little help.
I recently created a new repo on GitHub and cloned it on my desktop. Let’s call it myProject. I also have a fork in my GitHub account which I included in myProject as a submodule. Let’s call this myForkOfOtherProject, which is a fork of otherProject.
So, this is the current situation:

When a repo is cloned, it has a default remote called origin that
points to your fork on GitHub, not the original repo it was forked
from. To keep track of the original repo, you need to add another
remote named upstream.
So, my question is, how do I set the upstream to the submodule? Or am I not understanding something?
Thank you in advance.
Submodules
When you clone a submodule into your repository, it will have its own .git/config file and its own notion of origin. Assuming that the submodule is yours (e.g. there is no third-party repository upstream of your remote) then you don’t need to worry about creating an upstream remote for the submodule.
If you do need to create an upstream remote for your submodule, it’s easy enough. Just
cdinto the top-level directory of your submodule, and give it one the same way you did for the main repository.There is no namespacing conflict, because a submodule is really just a normal git repository with some additional meta-information tracked in the superproject. The superproject and the submodule do not share their .git/config files.
For all intents and purposes, you handle origin and upstream inside the submodule the same way you do for any other repository. Git commands that you run inside the submodule are independent of the superproject, which is mostly interested in tracking the submodule’s current commit ID.