2

I'm trying to install a new Symfony project without vendors preinstalled. I'm running Windows and i have used the following guide from the Symfony cookbook:

How to Create and store a Symfony2 Project in git

I'm fairly new to both Git and Symfony. When i run the bin/vendors script i eventually run into this:

Installing/Updating monolog
M src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php
M src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php
"monolog" has local modifications. Please revert or commit/push them before running this command again.

I'm running 2.0.15. I have tried (with the best of my limited knowledge on Git, cmd and Symfony) to fix this using this guide Dealing with line endings and eventually this Charles Baily's answer to 'Trying to fix line-endings with git filter-branch, but having no luck'.

I don't think I am doing it right though. I run the following lines from my cmd:

git config --global core.autocrlf true
#Nothing appears, just a new line

git rm --cached -r .
#Alot of files appear

git reset --hard
#HEAD is now at xxxxx initial commit

git add .
#According to the first link and Charles Baily's answer there should appear alot of files, but none do.

git commit -m "message"
#Nothing to commit

Does anybody have any clue to what I am doing wrong and how to fix this??

Community
  • 1
  • 1
Esben
  • 1,943
  • 1
  • 18
  • 37

2 Answers2

4

Here is how you may solve your problem:

  1. Go to the monolog directory

    cd vendor/monolog

  2. Understand what you changed (optional step)

    git diff

  3. Cancel your modifications

    git checkout .

greg0ire
  • 22,714
  • 16
  • 72
  • 101
  • This might work - solved my problem by other means. Se comment in VonC's answer. This could work for others, so thanks for the suggestion! – Esben Jun 05 '12 at 21:26
1

If your problem is with eol being automatically modified, then

git config --global core.autocrlf false

would be a better config, done before any other git operations.
See "Definitive recommendation for git autocrlf settings" for the pros and cons.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Okay, so i started a new project - run the above command before my git init->add->commit and then i ran bin/vendors install, but still same error? – Esben Jun 03 '12 at 10:38
  • @Esben then those local modifications aren't only due to eol conversions. The .gitignore that you must create at the beginning of the process should take care of local *private* modifications (ie those which shouldn't be versioned). Check what `git diff-index --quiet HEAD` returns (as in http://stackoverflow.com/questions/8170240/mercurial-internals-git-subrepository-status-after-aggressive-permission-chang). – VonC Jun 03 '12 at 10:51
  • I've gotten a new computer and had to reinstall Git. I noticed the CRLF option in the installation and set it to false (don't know what i had before). Since this the vendors script have been running perfectly, so i'm accepting your answer. – Esben Jun 05 '12 at 21:26