- Site name is
- Auto-deploys from GitHub
- GitHub repo is https://github.com/b3u/b3u.netlify.com
I have a script which pulls files from another git repo. Part of the process is making a merge commit. It works on my machine, but on Netlify the script fails because of a messy working tree. I’m not sure why a freshly cloned repo would have modifications…
2:16:05 PM: > firstname.lastname@example.org postinstall /opt/build/repo 2:16:05 PM: > node scripts/post-install 2:16:05 PM: Command failed: git subtree add --squash --prefix=src/notes/ notes master 2:16:05 PM: Working tree has modifications. Cannot add.
The script works on my machine, with a freshly cloned repo and the netlify-cli build command.
I looked through the documentation, read the blog post about the build process, and even looked through the build image github repo.
I haven’t seen Netlify’s git clone process documented, but I found some lines in the deploy log which may contain a hint. See the last line.
2:15:33 PM: No cached dependencies found. Cloning fresh repo 2:15:33 PM: git clone https://github.com/b3u/b3u.netlify.com 2:15:34 PM: Preparing Git Reference refs/heads/master