views:

572

answers:

5

Hi,

By default git init creates a folder called '.git'. In the recent Visual Studio tools (2005 and up) this works fine. But Visual Studio 2003 (and ... VB6 as well probably) crashes on this foldername. ideally I would like to change this per repository to something like 'git' instead of '.git'. Is this possible?

I know this has been asked before (http://stackoverflow.com/questions/672655/relocating-the-git-folder) ... but that was in a linux environment. I'm using windows at work sigh.

Hoping there is a simple solution .. otherwise I'll just have to wing it :o But I would rather use sexy git.

edit:

How do you set the GIT_DIR variable on windows? I googled it but it didn't make much sense.

edit2:

Wouldn't an environment variable set it for all repositories on that machine? If so I would have to go into every repository and move the folder manually ... also, I tried setting it to 'git' and when I open the git gui app it tells me "cannot use funny .git repository git". When I use the git console it works ... but honestly this is far from a good solution.

+3  A: 

The GIT_DIR variable allows you to specify another location for the repository.

David Plumpton
How do I do this properly on windows? I tried using git config, etc ... can't figure it out :(
SpoBo
This article explains how to change environment variables in Windows XP:http://support.microsoft.com/kb/310519
pgb
+2  A: 

You should be able to set the GIT_DIR environment variable, using this Knowledge Base guide.

pojo
+1  A: 

On Linux, at least, git has a command line option called --git-dir. Whenever you run git, use the --git-dir option. This should exist in the Windows version too, so you could do

 git --git-dir=git_directory status

Perhaps you could put that in a batch file or something to make your life easier.

Michael
+1  A: 

I'd suppose the easiest way is to not have any .sln files in the project root.

The project here has about 50 .sln files.

Joshua
It also fails when I just open the .vbproj file. (refreshing the tree that is)
SpoBo
Joshua
+1  A: 

Create all projects at least one level below the repository root.

robinr
Are you saying I should create one gigantic repository? :o
SpoBo
Ah I see what you are saying ... this might work! :) Going to give it a try.
SpoBo