We are using gitolite to manage our repositories and one of our heroku project's have git submodules. Is there a way to get Heroku's public key for the authentication?
Thanks, David
A git submodule is a record within a host git repository that points to a specific commit in another external repository. Submodules are very static and only track specific commits. Submodules do not track git refs or branches and are not automatically updated when the host repository is updated.
In order to add a Git submodule, use the “git submodule add” command and specify the URL of the Git remote repository to be included as a submodule. When adding a Git submodule, your submodule will be staged. As a consequence, you will need to commit your submodule by using the “git commit” command.
Pushing updates in the submodule. The submodule is just a separate repository. If you want to make changes to it, you should make the changes in its repository and push them like in a regular Git repository (just execute the git commands in the submodule's directory).
git submodule sync synchronizes all submodules while git submodule sync -- A synchronizes submodule "A" only. If --recursive is specified, this command will recurse into the registered submodules, and sync any nested submodules within.
No, probably not. Instead, you can use HTTPS basic authentication when you create the submodule in your git repository, similar to deploying private gems to Heroku. Looks something like this:
git submodule add https://username:[email protected]/username/repo.git
You can also commit a .ssh directory containing a dedicated id_rsa key ("deployment key") that is registered with github, either with your account or a dedicated deployment account. Don't forget to chmod 0660
the key.
There is another solution to @kanzure approach: https://stackoverflow.com/a/29464430/990356
Go to Settings > Personal access tokens and generate a personal access token with repo
scope enabled.
Now you can do git clone https://[email protected]/user-or-org/repo
and in the case of a submodule git submodule add https://[email protected]/user-or-org/repo
Pros:
Cons:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With