4

I've just started using git (like right this second). I've been invited to use a project that contains some submodules and I've been given permission through my Github account. When I cloned the repo, I got some errors:

$ git submodule init
Submodule 'js/Common/enginelite' ([email protected]:clientName/EngineLite.git) registered for path 'js/Common/enginelite'

$ git submodule update
Cloning into 'js/Common/enginelite'...
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Is there a way to pass credentials during this? Is there something I have to do locally or on Github? Thanks!

1

3 Answers 3

4

Look in js/Common/enginelite if there's a directory named .git edit the text file .git/config. If there's a file named .git, it will have a line that reads 'gitdir: ...' look in that directory and edit the config file there. Hopefully the contents of the file will show you where you can add your username@ in.

Sign up to request clarification or add additional context in comments.

1 Comment

Also found this on configuring ssh with explicit Identity files on SuperUser StackExchange: superuser.com/questions/272465/using-multiple-ssh-public-keys
1

If you want your git submodule to use the same authentication method as the parent repo and hosted in the same org, you can use a relative path in the git submodule. Provide the relative path in the .gitmodules file like below:

[submodule "test-git-sync"]
path = test-git-sync
url = ../test-git-sync.git # use relative path to the git repo

Comments

0

As a submodule is a separate git repository my best guess would be that you need to get permissions through your github account to access the main git repository EngineLit.git

I guess permissions are not inherited by submodules.

1 Comment

I can see the entire repo on github with my permissions. is there a way to add my key to my request?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.