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

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.

  • How can I advance my local branch by 1 commit?
  • git cherry pick - range of commits and exclude some in between
  • GIT Split Repository directory preserving *move / renames* history
  • Unstaged changes immediately after cloning in Eclipse
  • Trying to clone a repository in git, getting a error
  • Merging in changes from outside a git repository
  • Git-Svn dcommit causes branch splitting
  • When building only a subdirectory of a Git repo, Jenkins shows the changes of the whole repo - why?
  • Finding merge commits from tag across branches in git
  • git pull: There is no tracking information for the current branch
  • Merging with git - how do I figure out where the 'new' code ends?
  • git pull all branches from remote repository
  • 3 Solutions collect form web for “Is there any way to clone a git repository without a specific directory?”

    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.

    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.

    To avoid cloning one or several directories, you could use git sparse checkout as described here.

    Git Baby is a git and github fan, let's start git clone.