Recommended approach for accessing private git repo which is compatible with local builds via the CLI

cli

#1

Edited the original post to keep it a bit more succinct

I’m looking for a method to access a private git repo that’s compatible with the local build tool.

Essentially I’d like to have a step similar to the following:

run: git clone https://github.com/user/git-repo.git

Which will run successfully on the server and locally

Any help or direction much appreciated :slight_smile:


#2

Approach I’m going with for now is to create a git_user which has access (only) to my git-repo
I can then pass down a git ‘personal access token’ for git_user via an environment variable and expose that same token on the circle server

circleci build -e GIT_A_TOKEN=$GIT_A_TOKEN

Now my checkout step

git clone https://$GIT_A_TOKEN@github.com/user/git-repo.git

works locally and on the server


#3

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.