Search docs/

Using private Git repositories

During the build process, it might be necessary to access other private repositories containing, for instance, libraries.

In case such repositories do not belong to the same user that can clone the main application codebase, it is possible to use git credentials codebase.

How to use Git Credentials

The first step is to generate a personal access token: see the github or bitbucket documentation.

Then build an url for the Git Credentials.

The URL for github looks like:


while for bitbucket looks like:


where the username is the username of the account used to generate the token.

Finally add a secret inside an environment with key called GIT_CREDENTIALS and for the value use the url created before.

Git credentials token secret

At this point, if you use this environment during a build, you can access your repository specifying the https clone url without any token. For instance, if your private repo contains an npm library, the package.json would reference it in this way:

  "dependencies": {
    "my_super_secret_library": "",
Apflow + Jenkins/GitLab/GitHub
Using private NPM modules