Netlify build failed - failed during stage 'preparing repo': exit status 2


I’m trying to run a build from the ‘staging’ branch of my website.

At the moment it’s the same code as my master branch but I’m getting this error when netlify tried to build

“failed during stage ‘preparing repo’: exit status 2”

I’ve had a look around the board and google and can’t find anyone discussing ‘exit status 2’

Any help would be greatly appreciated! :slight_smile:


Could you tell us what site or at least the Deploy ID (last part of the URL for the deploy logs, a hexadecimal string)? That error can have multiple causes so we do probably have to look it up in our internal logs.

Hi Chris

The site is staging-cappfinity. The last time I ran deploy it gave an exit status 128. But I’ve checked all permissions on GitHub and the master branch of the same repo works



hi rich, we need the deploy id actually.

Here is how you find it:[your complete netlify site name]/deploys/

and then click on the last one - you should see the deploy ID in the URL bar. It’s a hexadecimal sequence like so:


Hi Perry

Here you go!


Hi Rich, we’re helping you in the support case you have open so please respond to us there. Thanks!