Answers.Body: <p>The error that you are seeing is because you have changes in your local repo that need to be saved (<code>committed</code>) first.</p>
  
  <p>I'm also a huge Git user and wanted to touch on a few items in your question.</p>
  
  <ol>
  <li><p>The <code>craft/app</code> folder should always be in your Git repository as its the foundation of making your site run Craft.</p></li>
  <li><p>If you want to see an example Craft Git project, you can take a look at this repository: <a href="https://github.com/themccallister/craft-foundation" rel="nofollow noreferrer">https://github.com/themccallister/craft-foundation</a> </p></li>
  <li><p>The only directories that should be ignored are <code>storage</code> (make sure you keep the actually directory using this trick: <a href="https://stackoverflow.com/questions/115983/add-empty-directory-to-git-repository">https://stackoverflow.com/questions/115983/add-empty-directory-to-git-repository</a>) and any directories in <code>public</code> that will contain user uploaded files (i.e <code>public/images/uploads</code>). This will ensure that the directory contents are not overwritten during deployment, ensuring that backups, sessions and user content will remain after the deploy.</p></li>
  </ol>
  
  <p>As far as your remote build... The typical workflow for Git should look something like this:</p>
  
  <ol>
  <li><p>Download and update Craft locally</p></li>
  <li><p><code>Commit</code> your changes to your local environment (should mostly be updates in the <code>craft/app</code> directory)</p></li>
  <li><p><code>Push</code> your changes to your remote repository (typically referred to as <code>origin</code> or <code>upstream</code>)</p></li>
  <li><p><code>Deploy</code> the update.</p></li>
  </ol>
  
  <p><strong>Note</strong>: If you are building using a tool like (<a href="http://dploy.io" rel="nofollow noreferrer">http://dploy.io</a>) you can login and push the changes to your environment. If you are SSHing into the server and running <code>git pull origin</code> that would work as well.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-13T20:35:57.077Z
Answers.LastActivityDate: 2014-12-13T20:35:57.077Z
Answers.LastEditDate: 2017-05-23T12:38:53.957Z
Answers.UserDisplayName: Jason McCallister
Body: <p>I've got a local db and install of Craft as well as a remote. I'm pushing to bitbucket from my local Mamp environment then pulling from bitbucket to my server via ssh. </p>
  
  <p>I recently updated Craft by clicking the prompt inside the dashboard. When I did this, it editing nearly every file in <code>/craft/app</code> leaving a ton of modified files registered in git. </p>
  
  <p>I should have had craft/app in my <code>.gitignore</code> file but I didn't. Now when I try to pull I'm getting this error:</p>
  
  <pre><code>error: Your local changes to 'craft/app/Info.php' would be overwritten by merge.  Aborting.
  Please, commit your changes or stash them before you can merge.
  </code></pre>
  
  <p>How can I force my remote build to ignore everything in craft/app so I can get back to pushing/pulling. </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-12-14T21:53:01.377Z
Comments.Text: While this question is really 80% Git and 20% Craft, I don't believe that it should be closed as "off-topic". After all, the question **is** related to Craft, specifically handling Craft updates across multiple environments. [Jason provides a solid answer](http://craftcms.stackexchange.com/a/5250/45) which does a good job of explaining (A) how to solve the problem, (B) what exactly is happening here, and (C) some advice in dealing with git workflow "best practices".
Comments.UserDisplayName: Lindsey D
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-12-14T21:58:34.827Z
Comments.Text: Jeremy, you may want to check out these related threads, which describe how others are handling their update workflow. To be clear, there is no single "right answer"... You've probably got two or three good ways that you could handle updating Craft across multiple environments. http://craftcms.stackexchange.com/q/13/45 | http://craftcms.stackexchange.com/q/4425/45 | http://craftcms.stackexchange.com/q/55/45 | http://craftcms.stackexchange.com/q/10/45
Comments.UserDisplayName: Lindsey D
Tags: <auto-updates><deployment><git>
Title: Updating Craft cause broken git and merge conflict
ThreadText: # Updating Craft cause broken git and merge conflict
  
  (Asked by: username_0 on 2014-12-13)
  
  I've got a local db and install of Craft as well as a remote. I'm pushing to bitbucket from my local Mamp environment then pulling from bitbucket to my server via ssh.
  
  I recently updated Craft by clicking the prompt inside the dashboard. When I did this, it editing nearly every file in `/craft/app` leaving a ton of modified files registered in git.
  
  I should have had craft/app in my `.gitignore` file but I didn't. Now when I try to pull I'm getting this error:
  
  ```
  error: Your local changes to 'craft/app/Info.php' would be overwritten by merge.  Aborting.
  Please, commit your changes or stash them before you can merge.
  
  ```
  
  How can I force my remote build to ignore everything in craft/app so I can get back to pushing/pulling.
  
  **Tags:** auto-updates, deployment, git
  
  > **Comments:**
  > **username_1**: While this question is really 80% Git and 20% Craft, I don't believe that it should be closed as "off-topic". After all, the question **is** related to Craft, specifically handling Craft updates across multiple environments. [username_2 provides a solid answer](http://craftcms.stackexchange.com/a/5250/45) which does a good job of explaining (A) how to solve the problem, (B) what exactly is happening here, and (C) some advice in dealing with git workflow "best practices".  
  > **username_1**: username_0, you may want to check out these related threads, which describe how others are handling their update workflow. To be clear, there is no single "right answer"... You've probably got two or three good ways that you could handle updating Craft across multiple environments. http://craftcms.stackexchange.com/q/13/45 | http://craftcms.stackexchange.com/q/4425/45 | http://craftcms.stackexchange.com/q/55/45 | http://craftcms.stackexchange.com/q/10/45  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2014-12-13. Score: 5
  
  The error that you are seeing is because you have changes in your local repo that need to be saved (`committed`) first.
  
  I'm also a huge Git user and wanted to touch on a few items in your question.
  
  1. The `craft/app` folder should always be in your Git repository as its the foundation of making your site run Craft.
  2. If you want to see an example Craft Git project, you can take a look at this repository: <https://github.com/themccallister/craft-foundation>
  3. The only directories that should be ignored are `storage` (make sure you keep the actually directory using this trick: <https://stackoverflow.com/questions/115983/add-empty-directory-to-git-repository>) and any directories in `public` that will contain user uploaded files (i.e `public/images/uploads`). This will ensure that the directory contents are not overwritten during deployment, ensuring that backups, sessions and user content will remain after the deploy.
  
  As far as your remote build... The typical workflow for Git should look something like this:
  
  1. Download and update Craft locally
  2. `Commit` your changes to your local environment (should mostly be updates in the `craft/app` directory)
  3. `Push` your changes to your remote repository (typically referred to as `origin` or `upstream`)
  4. `Deploy` the update.
  
  **Note**: If you are building using a tool like (<http://dploy.io>) you can login and push the changes to your environment. If you are SSHing into the server and running `git pull origin` that would work as well.
  
  
  ---
  
  