# How do I skip the "Preparing Working Directory" step?

**URL:** <https://forum.buildkite.community/t/how-do-i-skip-the-preparing-working-directory-step/468>\
**Category:** General\
**Created:** [May 4, 2019, 6:17am UTC](https://forum.buildkite.community/t/how-do-i-skip-the-preparing-working-directory-step/468 "2019-05-04T06:17:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathan.pierce](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/nathan.pierce/32/393_2.png) [@nathan.pierce](https://forum.buildkite.community/u/nathan.pierce)\
**Post date:** [May 4, 2019, 6:17am UTC](https://forum.buildkite.community/t/how-do-i-skip-the-preparing-working-directory-step/468/1 "2019-05-04T06:17:31Z")

</div>

How do I skip the “Preparing Working Directory” step to speedup my steps that don’t need to clone the repo?

---

<div class="post-metadata">

**Author:** ![anon18197598](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@anon18197598](https://forum.buildkite.community/u/anon18197598)\
**Post date:** [May 5, 2019, 4:08am UTC](https://forum.buildkite.community/t/how-do-i-skip-the-preparing-working-directory-step/468/2 "2019-05-05T04:08:10Z")

</div>

That is the `checkout` phase. In recent agents, you can set `BUILDKITE_REPO` to a blank string in a `pre-checkout` hook and it will skip it.

Might also be worth checking out [Shared git repository checkouts in the Agent](https://forum.buildkite.community/t/shared-git-repository-checkouts-in-the-agent/443).

---

<div class="post-metadata">

**Author:** ![anon85971592](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@anon85971592](https://forum.buildkite.community/u/anon85971592)\
**Post date:** [August 1, 2019, 3:00am UTC](https://forum.buildkite.community/t/how-do-i-skip-the-preparing-working-directory-step/468/4 "2019-08-01T03:00:12Z")

</div>

Did this solve your problem @nathan.pierce?

---

<div class="post-metadata">

**Author:** ![nathan.pierce](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/nathan.pierce/32/393_2.png) [@nathan.pierce](https://forum.buildkite.community/u/nathan.pierce)\
**Post date:** [October 22, 2019, 4:22pm UTC](https://forum.buildkite.community/t/how-do-i-skip-the-preparing-working-directory-step/468/5 "2019-10-22T16:22:46Z")

</div>

> [@anon18197598](#):
>
> BUILDKITE\_REPO

I wanted to follow up on this: Is there any way we can do this in specific steps? Adding it to the hooks makes me uncomfortable as it’s obscure to users of the mac fleet we have. It’d be nice to have an option on the same level as timeout, agents, and plugins, that can be set to avoid the preparing working directory only for certain steps.

---

<div class="post-metadata">

**Author:** ![anon18197598](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@anon18197598](https://forum.buildkite.community/u/anon18197598)\
**Post date:** [October 28, 2019, 12:38am UTC](https://forum.buildkite.community/t/how-do-i-skip-the-preparing-working-directory-step/468/6 "2019-10-28T00:38:12Z")

</div>

There isn’t currently, but @anon85971592 and I were discussing adding it to steps as `checkout: true|false` or possible `repository: url | null`

---

<div class="post-metadata">

**Author:** ![nathan.pierce](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/nathan.pierce/32/393_2.png) [@nathan.pierce](https://forum.buildkite.community/u/nathan.pierce)\
**Post date:** [October 28, 2019, 1:19pm UTC](https://forum.buildkite.community/t/how-do-i-skip-the-preparing-working-directory-step/468/7 "2019-10-28T13:19:22Z")

</div>

We ended up using the plugin to do this, but having it native would be way better and less of a security concern to pulling in a community plugin to our infrastructure/hosts in-house.

Our tests on Friday using the plugin to avoid the checkout cut a lot of wasted time out of the pipelines (more than we estimated); it’s really a great feature to have.

---

<div class="post-metadata">

**Author:** ![nathan.pierce](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/nathan.pierce/32/393_2.png) [@nathan.pierce](https://forum.buildkite.community/u/nathan.pierce)\
**Post date:** [October 28, 2019, 1:57pm UTC](https://forum.buildkite.community/t/how-do-i-skip-the-preparing-working-directory-step/468/8 "2019-10-28T13:57:36Z")

</div>

Also, I opened [Non-agent hook method of disabling the cloning/submodule update into working directory](https://forum.buildkite.community/t/non-agent-hook-method-of-disabling-the-cloning-submodule-update-into-working-directory/764) as a feature request for this. Not sure if that helps. We can re-vote for it if you need us to.
