# Builds directory for an agent should have just one checkout per repository

**URL:** <https://forum.buildkite.community/t/builds-directory-for-an-agent-should-have-just-one-checkout-per-repository/97>\
**Category:** Features Requests\
**Created:** [November 21, 2018, 5:21pm UTC](https://forum.buildkite.community/t/builds-directory-for-an-agent-should-have-just-one-checkout-per-repository/97 "2018-11-21T17:21:21Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![ccarpita-butterfly](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/ccarpita-butterfly/32/815_2.png) [@ccarpita-butterfly](https://forum.buildkite.community/u/ccarpita-butterfly)\
**Post date:** [December 7, 2020, 7:20pm UTC](https://forum.buildkite.community/t/builds-directory-for-an-agent-should-have-just-one-checkout-per-repository/97/8 "2020-12-07T19:20:12Z")

</div>

Git Mirrors are not a complete solution to this problem. For some repositories, a bulk of the space is consumed via LFS files, which will not be shared between mirrored repositories.

We’ve actually managed to solve this problem thanks to the configurability of the BUILDKITE\_BUILD\_CHECKOUT\_PATH variable in the global environment hook. This is what we use at Butterfly:

```auto
export REPO_SLUG=$(echo "$BUILDKITE_REPO" | cut -d: -f2 | sed 's/\.git$//')
export BUILDKITE_BUILD_CHECKOUT_PATH="$BUILDKITE_BUILD_PATH/$REPO_SLUG"

```

It works pretty well, but ideally we’d like to have a simple configuration flag for this.

**Feature Spec**

Add two configuration flags to control checkout path:

**checkout\_path\_includes\_pipeline** : true by default, settable to false. When true, the pipeline name will be included as part of the checkout path.

**checkout\_path\_includes\_hostname** : true by default, settable to false. When true, the hostname will be included as part of the checkout path.

---

_[View the full topic](https://forum.buildkite.community/t/builds-directory-for-an-agent-should-have-just-one-checkout-per-repository/97)._
