Git commands within circle.yml

Hi there. As part of my CI process for a dockerized python service, I’d like to perform some git commands. I’m running into permissioning issues.

I have a private Github organization with multiple repos in it. As part of the CI process for one repo, I’m trying to commit (configuration) to another one. Here are the specific commands I’m using.

- git clone
- cp docker-compose.yml risk-config/rancher/risk/
- cd risk-config && git status
- cd risk-config && git add -A
- cd risk-config && git commit -m "Updated config"
- cd risk-config && git push

I get an error on the git clone. I assume the CircleCI build agent is not permissioned to see this repo. This repo is in the same Github organization as the one the build is running against, though. Anyone in that Github organization should be able to see all repos.

Is there some kind of git login command I should be running?

git clone
Cloning into 'risk-config'...
Warning: Permanently added the RSA host key for IP address '' to the list of known hosts.

**ERROR: Repository not found.**
**fatal: Could not read from remote repository.**

Please make sure you have the correct access rights

and the repository exists. git clone returned exit code 128

Use the SSH connection to GitHub instead of HTTPS. That may help with permissions. I had a similar issue because you have to give a password with HTTPS, but you can’t do that in the script. SSH doesn’t require a password. Anyways, I’m no expert, but it might be worth a try.

1 Like

This is totally right, we only support working with git via SSH.