3

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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.