Git Line ending issue (CRLF would be replaced by LF) [Git-1]

 

When you are playing with Git, you may encounter this situation. Which is, more than painful from my point of view:

> git add wordpress-4.4/wp-content/plugins/crayon-syntax-highlighter
fatal: CRLF would be replaced by LF in wordpress-4.4/wp-content/plugins/crayon-syntax-highlighter/crayon_fonts.class.php.

[Git-1] EOL issue with Git - git add before

This mean you have an issue with the Operating System EOL (end of line) file format.

Read more

Search informations in multiple files [Shell-1]

You are searching a file containing some text but don’t remember where this damn file is !

I had this problem while I was trying Drupal on my MacBook Pro. I couldn’t find the php.ini file used by MAMP, and used the following command to help me:

find /Applications/MAMP -name "*.ini" -type f -exec grep -Hn nicolas-xdebug {} \;

This command is pretty much self-explanatory but the important point is that I knew I allready add the parameter “nicolas-xdebug” from a previous test. The options H and n in grep respectively print the name of the file where the pattern is find and the line number.

The result told me that the information I search are:

  • in the file /Applications/MAMP/bin/php/php5.6.10/conf/php.ini
  • at line 1171
  • the full line is xdebug.idekey=”nicolas-xdebug”

/Applications/MAMP/bin/php/php5.6.10/conf/php.ini:1171:xdebug.idekey=”nicolas-xdebug”

[Terminal-1] Search infos in multiple files - php.ini xdebug section

 

I can now update the PHP config file with the parameters needed by Drupal.