I have two git identifiers, one personal, the other for my employer.
My work project uses a submodule, and although I can clone the main repo, I cannot update the submodule. What do I need to configure so that the submodule can also be updated locally without getting the following error?
Fetching origin From github.com:/work_domain/work_submodule * branch HEAD -> FETCH_HEAD error: pathspec 'master' did not match any file(s) known to git.
I have 2 id_rsa key sets in the ~ / .ssh directory:
id_rsa.pub <= personal ssh key id_rsa_work.pub <= work ssh key
~ / .ssh / configuration file:
#work acccount Host github-work HostName github.com User git (corrected with info from answers) IdentityFile ~/.ssh/ida_rsa_work
When I initially cloned my working repo, I used the configured host mapping:
git clone git@github-work :work_domain/repo_name.git
instead of what i usually use when at work:
git clone git@github.com :work_domain/repo_name.git
As part of the repo working draft, the .gitmodules file, of course, has an official display:
[submodule "work_submodule"] path = work_submodule url = git@github.com :/work_domain/work_submodule.git
Following the suggestion below, I updated the .gitmodules attribute:
[submodule "work_submodule"] path = work_submodule url = git@github-work :/work_domain/work_submodule.git
But so far it has not been possible to update the submodule locally.