tags:

views:

89

answers:

5

Hi,

I want to share files between 2-3 windows pcs using Git. Do I need to set one of the pc's as the Git Server or is there any other options?

+2  A: 

Git is a DVCS, so you don't need to have a server (and there is no central server). Just copy over the repo and you're done. However, you could:

http://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt

Aviral Dasgupta
thank you for your answer. When you say "just copy over the repo", do you mean as in file copy over the network? But would'nt that make them two different repositories. How would I then get the latest changes between each other.
ravi
@ravi Yes, by `merging`. (and I did mean file copy)
Aviral Dasgupta
A: 

You should consider using git in conjunction with Dropbox. Its a great combination!

dbyrne
A: 

Git will do what you want, without requiring a server and there are plenty of other options.

The only other option I would recommend is mercurial. Mercurial is much simpler than git and is much faster on windows.

You should look into TortoiseGit, and TortoiseHG which provide explorer integration for git and mercurial. TortoiseGit is more mature than TortoiseHG, but I have found that TortoiseGit's icon overlays dramatically decrease the performance of windows explorer.

mikerobi
I've found the same performance problems with TortoiseSVN
dbyrne
I got a corrupted icon cache...
Aviral Dasgupta
@aviraldg That is fixable, but I don't remember how, google it
mikerobi
+1  A: 

I would use the built in Push/Pull methods. So you could have each of the repositories pulling and pushing code from each other.

In windows you can setup the other repositories by doing a "git remote add" and then if you share over normal windows sharing you can "//windowsMachine1/dir1". It is a bit strange but you will need to use forward slashes.

Ryan Alberts
thank you. I also found this very helpful http://www.jedi.be/blog/2009/05/06/8-ways-to-share-your-git-repository/
ravi
Ahh, excellent website! Thanks for sharing.
Ryan Alberts
And also I listed all the steps to collaborate over unc paths in windows @ http://blog.roonga.com.au/2010/06/setting-up-git-repository-over-network.html
ravi
+1  A: 

Technically, since Git is distributed, there is no critical need for a "central server" or "central repository", as it would traditionally be called.

I use both Git and Mercurial, and what we do in my office is use our "Dev" PC as our "central" repository location for all projects. So any time we clone a repository, we clone it from the same location. However, we could just as easily clone directly from one another, since cloning will bring all the repository information with it.

Thus, if your PC and your other 2 PCs were networked, you could easily act without a central repo. I would recommend "synchronizing" on occasion, in order to ensure that branching doesn't get too complex. It can get VERY complex if you have never used Git or another distributed version control system before, so that is definitely an advantage of using a central repository--you are more likely to have struggles using it as a pure distributed system until you've learned more about how Git actually functions.

Matt D