Can I add projects with submodules or with private repo dependencies?

If you have a project with one or more submodules or other private repository dependencies (for example, CocoaPods repositories), you have to grant access to all repositories for a successful build.

There are two ways to achieve this:

Use a machine user with read only access

It is not required to use a special bot/machine user: you can add the SSH key to your own account on the git hosting service. The best practice, however, is to use a machine user, with read only access, for those repositories you want to access during the build.

GitHub itself recommends this method for accessing multiple repositories.

On GitLab and Bitbucket it’s possible to register a single SSH key as a “Deployment key” to multiple repositories, without the need to create a “bot” / “machine” user.

Git cloning submodules and repository dependencies

There is one important detail to keep in mind when you want to give access to all submodules or private repository dependencies for an app: the app’s privacy settings determine what git URL should you use.

Cloning issues

If you encounter issues with git cloning - for example, not all submodules are cloned - try the following command after cloning:

git submodule update --recursive --remote --merge --force

Creating SSH keys for a new private app

There are three options to grant Bitrise access to your repository:

Managing SSH keys of an existing private app

You can find the public SSH key of the app in the Settings of the given app on Bitrise. Scroll down to the SSH settings section and click Show SSH Public Key.

Copy the key to the given user and you are ready to build!

If necessary, update the given app’s SSH key by clicking the Change SSH Keypair button and choosing one of the three options.