0

I have a vagrant box where I change the default Ubuntu shell to oh-my-zsh. I have a shared folder containing a .zshrc that I copy to the vagrant home folder during provisioning. At some point the line ending for one line in the .zshrc has ^M appended to it so I get the following error when I vagrant ssh:

/home/vagrant/.zshrc:source:4: no such file or directory: /home/vagrant/.oh-my-zsh/oh-my-zsh.sh^M

The ^M is not visible in the .zshrc file. If I use vim in the vagrant box and re-write the .zshrc file then everything works as expected.

How can I ensure my .zshrc won't have this line ending character appended during the process of git clone-ing the repo and vagrant up-ing the box?

I'm using Vagrant in Windows 7.

bordeltabernacle
  • 1,603
  • 5
  • 24
  • 46
  • look this one for git config http://stackoverflow.com/a/37261875/4296747 – Frederic Henri May 19 '16 at 09:03
  • ah, yes adding the lines `git config --global core.autocrlf false` & `git config --global core.eol lf` to my windows machine fixed it, thankyou! If you put as an answer I'll accept it. :) thanks. – bordeltabernacle May 19 '16 at 10:26

1 Answers1

1

based on this you can make the following setting in git

git config --global core.autocrlf false
git config --global core.eol lf

and you will have no issues when cloning the project

Community
  • 1
  • 1
Frederic Henri
  • 51,761
  • 10
  • 113
  • 139