Getting fatal: Dirty repository: Having uncommitted changes. Exiting… in Pipelines with git ftp push

微笑、不失礼 提交于 2020-05-30 03:19:31

问题


I have a Pipelines setup with automatic processing/building of CSS files. Some of the time I get this error when doing git ftp push:

fatal: Dirty repository: Having uncommitted changes. Exiting...

bitbucket-pipelines.yml

image: php:7.2.7

pipelines:
 branches:
   staging:
     - step:
         name: Deploy to staging
         deployment: staging
         script:
           - curl -sL https://deb.nodesource.com/setup_8.x | bash -
           - apt-get install -y nodejs
           - npm install
           - npm run build-css
           - apt-get update
           - apt-get -qq install git-ftp
           - git status -uno --porcelain
           - git ftp push --user $FTP_username --passwd $FTP_password ftp://ftp.website.com

Output from git status -uno --porcelain

git status -uno --porcelain
 M style.css

In the past I have committed style.css (what is now getting built automatically)-- but now want it to ignore my local style.css file as it is getting generated during the build anyways. How can I fix this?


回答1:


I think it's too late but today I faced the same problem. After some research I deleted yarn.lock file from the repo and the problem disappear. Hope that helps!



来源:https://stackoverflow.com/questions/58565212/getting-fatal-dirty-repository-having-uncommitted-changes-exiting-in-pipel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!