---
title: "How to resolve \"uncommitted changes\" issue in your build process?"
date: "2024-04-09T08:26:13+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/94246-how-resolve-uncommitted-changes-issue-your-build-process"
id: "0e9de646-5a34-4305-b70a-cddaca76389d"
---

Table of contents will be added

Issue
-----

Getting the following error during the BLT, Code Studio, ACLI or Pipelines build process shows that you have uncommitted changes but when you check your branch everything has been committed and you do not see any uncommitted files.  
  
**ACLI**

    In PushArtifactCommand.php line 100:
                                                                                   
      [Acquia\Cli\Exception\AcquiaCliException]                                    
      Pushing code was aborted because your local Git repository has uncommitted   
      changes. Please either commit, reset, or stash your changes via git.

**BLT**

    [Exec] Exit code 1
    
    [error] There are uncommitted changes on the source repository (listed above). Commit, stash, or remove these changes before deploying, or use the --ignore-dirty flag.

**Code Studio**

    You have committed files or directories that Acquia recommends gitignoring.
    Please do not commit any of the following files or directories:
    vendor, node_modules, docroot/composer.json, docroot/libraries, docroot/core, docroot/modules/contrib, docroot/themes/contrib, docroot/profiles/contrib

Cause
-----

This is happening  because a lot of these directories are committed in your codebase currently when they should be _gitignored_ so _composer_ can add them during the build for you. This is relevant because when you pull your repository to a new local folder and run _composer install_ you can see several files are changing when running _git status_. 

### How to identify and get an extra output to see the uncommitted files:

To get this extra output, you can add a [before\_script](/node/56077 "https://docs.acquia.com/code-studio/customizing/customizing-default-code-studio-pipeline/#adding-a-before-script-or-after-script-to-a-code-studio-job") to the stage and output `git status` and `git diff`. Basically, you would just need to append this to the end of your `.gitlab-ci.yml` (Code studio) or equivalent of any CI/CD build process.

    "Create artifact from branch":
      before_script:
        - git status
        - git diff

Resolution
----------

*   Clone the repo in a new folder. You should not have core directory and of course vendor folder and others. 
*   Remove the docroot/core from your .gitignore. Commit your change using Git. 
*   Remove the actual  folder and commit your change using Git.
*   Add the docroot/core back to the .gitignore. Commit your change using Git. 

  
The bottom line, you should not have the core directory in your repository when you are using push build artifact. Push build artifact will generate them for you. Use this sample for your gitignore: 

*   https://github.com/acquia/drupal-recommended-project/blob/master/.gitignore

This is an example for like \`core\` directory. You should check the other file and folder that is in the .gitignore. You should do the same thing for the other files/folders in the .gitignore to resolve this issue.  
Example recommended .gitignore file: 

*   https://github.com/acquia/drupal-recommended-project/blob/master/.gitignore

  
Example for clarification:  
  
For example if you want to ignore file/folder X in your repo, you will need to add the file/folder X to the .gitignore. This means that you want to ignore the future changes in this folder/file. In other words, you are not ignoring the past changes. Basically if you have the file/folder X in your repository, it will stay in your repository even you add it to .gitignore.

Related Content
---------------

"[Should I commit the dependencies in my vendor directory?](https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md#should-i-commit-the-dependencies-in-my-vendor-directory-)"