Search code examples
windowsgit-shell

.bashrc and .profile errors with 'sh.exe": ÿþe: command not found' on git-shell start windows 7?


I've just installed git on a newly imaged laptop with windows 7 and I get this message when I open git shell:

Welcome to Git (version 1.9.4-preview20140611)

Run 'git help git' to display the help index. Run 'git help ' to display help for specific commands. sh.exe": ÿþa: command not found sh.exe": ÿþe: command not found sh.exe": ÿþe: command not found

I also found that no options set in the .profile are set, so tried source .profile and .bashrc but this results in the same error (sh.exe": ÿþe: command not found), anyone else solved this problem?

You should know this is a corporate laptop where my home directory is on a network share so git's home is h:\ instead of C:\Users\\ not sure if this complicates things.


Solution

  • Convert your files from UTF-16 to a single byte encoding like ASCII. Make sure any editor you use doesn't change it back.

    The "ÿþ" characters are the 16-bit little endian version of the Unicode byte order mark.