Reputation: 358
I need help to use git installed under windows to work well from cygwin shell.
I see that git is not interpreting path well when invoked under cygwin shell.
$ git --version
git version 1.8.0.msysgit.0
$ git config --global --add user.name miten.mehta
error: could not lock config file D:\software\cygwin\home\Miten Mehta/.gitconfig: Permission denied
Upvotes: 0
Views: 2725
Reputation: 55573
Cygwin is a POSIX emulation layer (and a set of tools and programs relying on it to function) for Windows. Git for Windows, which you installed, is a native Windows application which does not use Cygwin and knows nothing about it.
The problem with pathnames is probably due to the fact GfW and Cygwin runtime both use certain quirks to work with pathnames on Windows.
What you should do is decide what exactly is your need.
GfW works perfectly in any Windows shell (regular cmd.exe
, 3rd-party emulators like Console2
, PowerShell etc), and also comes with its own Windows port of the bash
shell (called Git Bash).
Hence one approach is just to adopt a better shell for Windows.
If you think you need Cygwin, then use its native tools as suggested by Steven—that is, install Git for Cygwin using Cygwin tools, and then use it in the Cygwin shell only.
Note that if you'll want to use one of popular 3rd-party GUI front-ends for Git, such as Git Extensions or TortoiseGit, you'll need Git for Windows. So my personal pick is to use GfW unless you need Cygwin for other purposes or are okay with working with Git within the Cygwin's ecosystem.
Upvotes: 3
Reputation: 1
Install Git using official installer
setup-x86_64 -qP git
apt-cyg install git
Upvotes: 1