Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to clone a git repository without a specific directory?

Tags:

git

windows

I just want to clone illumos-gate repository on my Windows machine. But unfortunately, there is an directory named 'aux' which is not allowed to be created in Windows since Windows regards aux as some device name. So is there any way to clone the whole git repository without this specific directory? Thanks in advance.

like image 576
Michael Avatar asked Sep 07 '11 02:09

Michael


2 Answers

Update: since the MSys2, on which all 2.x versions of Git For Windows are built, is a fork of Cygwin, these special filenames should now work just fine. You'll only have the issue if you are using ancient version (note the date of the question—2011).


While it's not possible with native windows tools or with msys, it is possible to create such directory with cygwin. So you can use cygwin git instead of msys one as workaround.

The cygwin git has three main disadvantages compared to the msys one: It does not register itself with the system, so you don't get the context menu in explorer (can be set manually, it's just an entry in registry), it's gui and gitk only work when cygwin X server is running and it sets funny access lists to everything as cygwin tries to emulate unix permissions (that can be tunred off in /etc/fstab and I always do that; don't forget to set core.filemode to false in git than so it does not try to track executable bit). So that's why I normally use msys git even when running from cygwin, but as that does not work for you, cygwin git should be good enough substitute.

like image 50
Jan Hudec Avatar answered Nov 15 '22 10:11

Jan Hudec


I can only think of a way which is rather painful:

Do a git clone without doing a checkout - git clone path --no-checkout

Now do a git reset - git reset

Now checkout every other file and folder except the aux one - git checkout master -- files/folders

Don't stage the deleted: aux/... changes

Clearly, very painful. Only proper way is to clone and work on Linux.

like image 37
manojlds Avatar answered Nov 15 '22 08:11

manojlds