I'm working on a project which uses AWS CodeCommit, and has 2 main apps, plus a submodule of shared components. On Windows I was able to clone all 3 repositories, and then I navigated into the sharedComponents directory in each of the main apps, and ran
git submodule update --init --recursive
This linked the shared components to the main app, and all was fine.
On Mac, however, I first had difficulty in cloning the repositories at all; eventually I got this working by setting up an ssh public private key pair (saved in ~/.ssh) and cloning that way. However, the git submodule
command that I used above doesn't work in this scenario, and gives the error:
fatal: unable to access 'https://git-codecommit.eu-west-1.amazonaws.com/v1/repos/MyRepoName/': The requested URL returned error: 403
which is the error I get when it can't access the security credentials.
So, I suspect that I need to tell git submodule update
to use SSH mode, or to call the ssh version of the URL or something like that, but I'm not sure how to do this.