Git repository is dirty (Podfile.lock)


I’m running into an issue on circleCI where it’s complaining about the repo being dirty and it’s supposedly related to the Podfile.lock file. The problem is I’m unable to reproduce it locally – when I run ‘bundle exec fastlane run ensure_git_status_clean’ everything is clean .

When using an older version of cocoapods (1.7.5) – as opposed to 1.9.0+, the error goes away.

Could it be related to the fact that I’m upgrading from cocoapods 1.7.5 to 1.9+? Would that trigger a failure? If yes, if there a way to prevent that failure somehow?

Any guidance would be appreciated.


I found this issue on the CoacoaPods repo that sounds similar, and it seems the version changes mentioned in the issue align with yours as well. Can you ssh into the job and see how the Podfile.lock is being modified? There’s a fix suggested at the bottom of the thread, but it would be good to know what is being modified before attempting a fix.

Hi @fernfernfern,
There is one line that’s different. In the SPEC REPOS section of Podfile.lock, the file being generated by CircleCI replaces ‘’ with ‘trunk:’
Thanks for helping out on this.

A little update:

Git diff highlights several lines related to our private pods’ spec repos, but when I ssh and compare the Podfile.lock to the one I have in mysystem, only one line is different. (mentioned above)

I tried locally deleting and recloning both master and our private pods’ spec repo to no avail.


Can you take a look at this section of our docs for optimizing coacoapods as there are suggestions for updates to your podfile which need to be made along with updating coacoapods to a version >=1.8.0. After making the changes and committing them to your repo see if the triggered job still ends up dirty.

Hi @fernfernfern,
I finally figured out the problem. I had to delete my master repo and run pod install. After that, my master repo was replaced with a trunk repo, which is what recent versions of cocoapods use.
Thanks for your help!

1 Like