This is an old revision of the document!


As of this writing, the official git distribution for Windows is the cygwin version. However, Msysgit is also popular, but Msysgit and cygwin's git won't play nice together. You can use cygwin's git for all real work and just have Msysgit for the easy icon display to identify versioning changes.

It is advisable to set up common paths that both cygwin git and msysgit (and tortoisegit) can clone/pull/push to and from. The best way I've found is to either use ssh entirely (although I haven't tried ssh over tortoise yet), or to make mount points. Mount points involve 3 places:

  1. in cygwin, we create a mount point by this command in our “~/.profile”. It also is set with noacl so permission errors won't become a problem
    mount -f -o binary,posix=0,noacl //unc/or/cygwin/file/path/git /gitshare
  2. in windows (dos shell), we create a symbolic link at the root of C. This will allow us to put the exact url that we used in cygwin, which in this case is /gitshare/path/to/repo.git (windows/msysgit/tortoisegit will resolve /gitshare to c:\gitshare)
    open a dos shell by running as administrator (only administrator can run mklink command)
    c:
    cd
    mklink /D gitshare x:\path\to\git\repo
  3. lastly, we set up a link in the same way so msysgit can find it when using a bash shell in msysgit
    c:
    cd "Program Files (x86)\Git" (or wherever you installed msysgit)
    mklink /D gitshare x:\path\to\git\repo

If you do try to use cygwin git and msysgit together, you may notice the msysgit will identify all files as changed when a project is cloned via cygwin git. This is because cygwin git sets core.filemode = true for each cloned repository. It doesn't even matter if you have filemode = false in your ~/.gitconfig, it will set it based on detected file system capability.

To fix this, you can either remember to set filemode = false in each repo's .git/config file, or use msysgit to clone the project.

  • docs/git/git_on_windows.1286823498.txt.gz
  • Last modified: 2010/10/11 12:58
  • by billh