Git and Windows Shared Folders

With the msysGit package (Git for Windows), we can use Git easily under Windows environments. Even if you want repositories on Windows servers, you can make it in shared folders. Yes, you need only shared folders instead of running git-daemon on your server. When you manipulate repositories on shared folders, you can use a syntax bellow to identify the repository without mapping the shared folder as a drive.

//servername/folder/subfolder/repository

If you want to create a new empty bare repository on a server.

$ git init --bare //server/folder/git/myproj.git

If you want to clone your local repository to a new bare repository on a server.

$ git clone --bare myproj //server/folder/git/myproj.git

When cloning a repository with GUI of Git for Windows (git-gui), use ‘Full Copy’ option to avoid warnings because the syntax above is identified as a local repository by the program. Without the option, it tried to hardlink some files and failed. In my experience, I haven’t seen such messages when I did ‘git clone’ on command lines even without ‘–no-hardlinks’ option.