Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use mSysGit and Cygwin's git?

After migrating to Windows, I'm using msysgit with its included bash shell, and that's working well for me. But I have issues: our ant build process won't run in that shell, I'd like to use Cygwin's xterms instead of the Windows command window, since the terminal compatibility isn't good enough to run everything else I'd like in that window, and so on.

I've actually made a go of sticking with msysgit in the Windows command shell so that I don't have to use a separate window to build, but that's got even more problems: the lack of cd - and file completion is killing me, most of the commands I'd like to pipe to aren't present, etc.

So if I switch to using Cygwin's git, or worse, use both at different times, are line-endings going to bite me? Will Cygwin's git expect everything to be \n and think it's seeing changes because mSysGit converted to \r\n when checking out? Will Cygwin's git check out as \n and confuse my Windows Eclipse, which I'm sure wants everything to be \r\n?

like image 225
skiphoppy Avatar asked Mar 27 '09 16:03

skiphoppy


2 Answers

The simplest approach would be to set any git (msysGit or Cygwin git) to ignore crlf styles.

core.autocrlf=false

That way, you do not have ant unwanted conflict.

like image 61
VonC Avatar answered Oct 11 '22 08:10

VonC


Will Cygwin's git check out as \n and confuse my Windows Eclipse, which I'm sure wants everything to be \r\n?

Most modern applications (including Eclipse) are perfectly capable of using \n only.

There are a few annoying exceptions (e.g. email protocol), but in most cases you can stick to just using \n for everything.

So, as VonC says, just disable the autocrlf setting and it'll be fine.

like image 3
Peter Boughton Avatar answered Oct 11 '22 09:10

Peter Boughton