How to push a commit back to the same repository as part of the CircleCI job

You may have a use case for creating a new commit and pushing it to the same repository as part of your CircleCI job.

Configuration Steps 

Here is how you can configure your CircleCI project to enable the above-mentioned use case.

1) Decide if you wish to configure the project with a user key generated by CircleCI or a manually-created read-write deployment key

1a) If you wish to use a user key, simply visit:[your vcs-type]/[your org-name]/[your project-name]/ssh 

and click on the "Authorize with GitHub" button.

1b) If you wish to use a read-write deployment key, follow the steps here to create it and configure the project so that the key has write permissions for it: or for Bitbucket users


Common Issues:

1) "*** Please tell me who you are." error message upon running "git commit"

In your CircleCI configuration file (config.yml), you might have to add commands to configure an email and user name with `git config` prior to running `git commit`, e.g.

git config ""
git config "My Name"

2) Running git push results in "ERROR: The key you are authenticating with has been marked as read only."

The deploy key that the project is configured with, by default when you add a project on CircleCI, only has read access, so a key with write permissions needs to be configured to be used, to avoid the above error message. Please ensure that a user key or a read-write deployment key has been configured for the project (See "Configuration Steps" above).

If you are using a read-write deployment key, please add an add_ssh_keys step to your configuration. The fingerprints value should match what is shown on[your vcs-type]/[your org-name]/[your project-name]/ssh 


3) How to stop your generated commits from triggering new builds

To prevent a commit from triggering a new build, add "[skip ci]" to the commit message. For more details, see:


Was this article helpful?
20 out of 61 found this helpful



Article is closed for comments.