Answers.Body: <p>Applying the project config will always be a onedirectional operation, it applies the state of your <code>config/</code> folder to your database. Applying the project config through the control panel is the same as the <code>project-config/apply</code> command. To apply changes in the opposite direction (database -&gt; <code>config/</code> folder), there are the <code>project-config/write</code> and <code>project-config/rebuild</code> command, see <a href="https://craftcms.stackexchange.com/a/39137/11705">this answer</a> for details.</p>
  <p>That said, it's not guaranteed that applying the project config will never perform any file system operation. Every system component and plugin can listen to project config changes and do whatever they want in reaction to those. For example, a project config change to a file system's base path may create that directory on the filesystem (not sure if that actually happens at that point, it's just an example). Other plugins may create files or move folders around as a reaction to project config changes.</p>
  <p>That said, those changes mostly happen in folders that usually aren't tracked in git (<code>storage</code>, <code>web</code>, etc) and applying the project config should <em>never</em> change the contents of the <code>config/</code> folder. I would ditch a plugin that does this immediately.</p>
  <blockquote>
  <p>Working with Windows WSL2 is really a pain regarding file permissions, sometimes I find myself with modified project files that I don't want to commit and my only option is to do a git reset, because reverting them is problematic with WSL2.</p>
  </blockquote>
  <p>This is your real problem. You can never work productively with a system you don't have full control over. Instead of trying to contain the fallout, invest the time to get your development environment under control. For example, you could:</p>
  <ul>
  <li>Use Docker to set up a predictable, reproducible environment.</li>
  <li>Install a dedicated Ubuntu installation on your Windows PC with a dual boot setup.</li>
  <li>Buy a dedicated machine for development with Linux or macOS.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-02T07:47:06.260Z
Answers.Text: +1 for the advice on "Buying a dedicated machine for development with Linux or macOS". Windows really just doubles the energy required to get things done.
Answers.UserDisplayName: Álvaro Franz
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-02T08:43:38.337Z
Answers.Text: @ÁlvaroFranz Yeah, Windows is a pain for development. I hate to recommend Apple devices, but macOS is really much simpler for web dev, I use a Mac Mini at work. Though I have a dual boot setup with a dedicated Ubuntu installation at home, this works reasonably well, so it's a good starting point that doesn't cost anything if you've already got a Windows machine.
Answers.UserDisplayName: MoritzLost
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-02T07:42:30.277Z
Answers.LastActivityDate: 2022-08-02T07:42:30.277Z
Answers.UserDisplayName: MoritzLost
Body: <p>When I get a fresh copy of whatever lives in a git repository, I may be getting some changes to the project YAML files.</p>
  <p>So far, so good.</p>
  <p>When Craft detects that those files contain un-applied changes, it will say:</p>
  <blockquote>
  <p>&quot;Your project config YAML files contain pending changes.&quot;</p>
  </blockquote>
  <p>What I want to know is, when I apply those changes, is it always a <em>files --&gt; db</em> sync, or will there ever be a <em>db --&gt; files</em> sync?</p>
  <p>Does it also perform other changes in files or is this always a sync into the database <strong>and nothing else</strong>?</p>
  <p>I want to know this to be aware of what is going on in my git status and predict things before they happen.</p>
  <p>Working with Windows WSL2 is really a pain regarding file permissions, sometimes I find myself with modified project files that I don't want to commit and my only option is to do a git reset, because reverting them is problematic with WSL2.</p>
  
Tags: <project.yaml>
Title: What exactly happens when YAML files pending changes are applied?
ThreadText: # What exactly happens when YAML files pending changes are applied?
  
  (Asked by: username_0 on 2022-08-02)
  
  When I get a fresh copy of whatever lives in a git repository, I may be getting some changes to the project YAML files.
  
  So far, so good.
  
  When Craft detects that those files contain un-applied changes, it will say:
  
  > "Your project config YAML files contain pending changes."
  
  What I want to know is, when I apply those changes, is it always a *files --> db* sync, or will there ever be a *db --> files* sync?
  
  Does it also perform other changes in files or is this always a sync into the database **and nothing else**?
  
  I want to know this to be aware of what is going on in my git status and predict things before they happen.
  
  Working with Windows WSL2 is really a pain regarding file permissions, sometimes I find myself with modified project files that I don't want to commit and my only option is to do a git reset, because reverting them is problematic with WSL2.
  
  **Tags:** project.yaml
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-08-02. Score: 2 | Accepted answer
  
  Applying the project config will always be a onedirectional operation, it applies the state of your `config/` folder to your database. Applying the project config through the control panel is the same as the `project-config/apply` command. To apply changes in the opposite direction (database -> `config/` folder), there are the `project-config/write` and `project-config/rebuild` command, see [this answer](https://craftcms.stackexchange.com/a/39137/11705) for details.
  
  That said, it's not guaranteed that applying the project config will never perform any file system operation. Every system component and plugin can listen to project config changes and do whatever they want in reaction to those. For example, a project config change to a file system's base path may create that directory on the filesystem (not sure if that actually happens at that point, it's just an example). Other plugins may create files or move folders around as a reaction to project config changes.
  
  That said, those changes mostly happen in folders that usually aren't tracked in git (`storage`, `web`, etc) and applying the project config should *never* change the contents of the `config/` folder. I would ditch a plugin that does this immediately.
  
  > Working with Windows WSL2 is really a pain regarding file permissions, sometimes I find myself with modified project files that I don't want to commit and my only option is to do a git reset, because reverting them is problematic with WSL2.
  
  This is your real problem. You can never work productively with a system you don't have full control over. Instead of trying to contain the fallout, invest the time to get your development environment under control. For example, you could:
  
  * Use Docker to set up a predictable, reproducible environment.
  * Install a dedicated Ubuntu installation on your Windows PC with a dual boot setup.
  * Buy a dedicated machine for development with Linux or macOS.
  
  > **Comments:**
  > **username_0**: +1 for the advice on "Buying a dedicated machine for development with Linux or macOS". Windows really just doubles the energy required to get things done.  
  > **username_1**: @username_0 Yeah, Windows is a pain for development. I hate to recommend Apple devices, but macOS is really much simpler for web dev, I use a Mac Mini at work. Though I have a dual boot setup with a dedicated Ubuntu installation at home, this works reasonably well, so it's a good starting point that doesn't cost anything if you've already got a Windows machine.  
  
  ---
  
  