# Is it possible to include git commands in pipeline.yaml?

**URL:** <https://forum.buildkite.community/t/is-it-possible-to-include-git-commands-in-pipeline-yaml/2985>\
**Category:** Pipelines\
**Created:** [June 28, 2023, 4:11am UTC](https://forum.buildkite.community/t/is-it-possible-to-include-git-commands-in-pipeline-yaml/2985 "2023-06-28T04:11:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebanster](https://avatars.discourse-cdn.com/v4/letter/e/41988e/32.png) [@ebanster](https://forum.buildkite.community/u/ebanster)\
**Post date:** [June 28, 2023, 4:11am UTC](https://forum.buildkite.community/t/is-it-possible-to-include-git-commands-in-pipeline-yaml/2985/1 "2023-06-28T04:11:44Z")

</div>

Hi team,

I have a process where a json file gets updated after triggering a build. That file needs to be committed then create a PR to the master branch located in Bitbucket. Is it possible to do this via scripts or directly on the yaml file?

I found this plugin but seems very minimal with the commands:

> **[GitHub - thedyrt/git-commit-buildkite-plugin: A Buildkite plugin to commit...](https://github.com/thedyrt/git-commit-buildkite-plugin)**
>
> A Buildkite plugin to commit and push changed files to a git repository - GitHub - thedyrt/git-commit-buildkite-plugin: A Buildkite plugin to commit and push changed files to a git repository

---

<div class="post-metadata">

**Author:** ![benmc](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/benmc/32/1159_2.png) [@benmc](https://forum.buildkite.community/u/benmc)\
**Post date:** [June 28, 2023, 5:06am UTC](https://forum.buildkite.community/t/is-it-possible-to-include-git-commands-in-pipeline-yaml/2985/2 "2023-06-28T05:06:54Z")

</div>

Hey @ebanster!

This would be possible, yes; the agent AMI has `git` installed on it, so in theory it can run any `git` commands that you need it to.

There is another [plugin](https://github.com/envato/github-pull-request-buildkite-plugin) which can open up Pull Requests which may be of use. Does this JSON file change in the build, then you want to commit it back to `origin` as a PR?

---

<div class="post-metadata">

**Author:** ![ebanster](https://avatars.discourse-cdn.com/v4/letter/e/41988e/32.png) [@ebanster](https://forum.buildkite.community/u/ebanster)\
**Post date:** [July 10, 2023, 6:05am UTC](https://forum.buildkite.community/t/is-it-possible-to-include-git-commands-in-pipeline-yaml/2985/3 "2023-07-10T06:05:20Z")

</div>

Thanks mate. We were able to figure it out by just using the git commands via the agent AMI.

---

<div class="post-metadata">

**Author:** ![paula](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/paula/32/954_2.png) [@paula](https://forum.buildkite.community/u/paula)\
**Post date:** [August 29, 2023, 5:39am UTC](https://forum.buildkite.community/t/is-it-possible-to-include-git-commands-in-pipeline-yaml/2985/4 "2023-08-29T05:39:31Z")

</div>


