Note that there are some explanatory texts on larger screens.

plurals
  1. POUpdating a submodule when multiple git accounts are configured
    text
    copied!<p>I have two git identities, one is a personal one and the other is for my employer. </p> <p>My work project uses a submodule and although I can clone the main repo fine, I am not able to update the submodule. What do I need to configure so the submodule can also be updated locally without getting the following error?</p> <pre><code>Fetching origin From github.com:/work_domain/work_submodule * branch HEAD -&gt; FETCH_HEAD error: pathspec 'master' did not match any file(s) known to git. </code></pre> <p>I have 2 sets of id_rsa keys in my ~/.ssh directory:</p> <pre><code>id_rsa.pub &lt;= personal ssh key id_rsa_work.pub &lt;= work ssh key </code></pre> <p>~/.ssh/config file:</p> <pre><code>#work acccount Host github-work HostName github.com User git (corrected with info from answers) IdentityFile ~/.ssh/ida_rsa_work #personal account Host github-personal HostName github.com User git Identity ~/.ssh/ida_rsa </code></pre> <p>When I initially cloned my work repo successfully, I used the adjusted host mapping:</p> <pre><code>git clone git@github-work:work_domain/repo_name.git </code></pre> <p>instead of what I normally use when at work:</p> <pre><code>git clone git@github.com:work_domain/repo_name.git </code></pre> <p>Within the work project repo, the .gitmodules file of course has the official mapping:</p> <pre><code>[submodule "work_submodule"] path = work_submodule url = git@github.com:/work_domain/work_submodule.git </code></pre> <p>Per suggestion below, I updated the .gitmodules attribute to be:</p> <pre><code>[submodule "work_submodule"] path = work_submodule url = git@github-work:/work_domain/work_submodule.git </code></pre> <p>But still can't update the submodule locally.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload