views:

10217

answers:

10

My friends and I are trying to setup Git for Windows using the tutorial Git Server: Gitosis and Cygwin on Windows, but we just keep running into problems.

What would a "Setup Git Server" guide for Windows using msysgit be like?

There is a comment in the tutorial above suggesting it can't be done with msysgit because gitosis requires the use of an SSH Server and Bash? What is a step by step guide (as there is not one available)?

  1. Install mysisgit

  2. ?

+2  A: 

There may simply not be such a guide. If so, you may not have much luck convincing anybody to write one, because it would be a lot of work.

I would recommend either of two things. The easier one is to follow the guide you have slavishly, which means forgetting about msysgit.

The harder one is to put up a Linux server - perhaps as a guest under Windows using VirtualBox (free) or VMWare or Parallels (pay), and then follow one of the many sets of instructions Google will lead you to. But you will probably find those instructions are insufficient - they usually assume you've already set up an ssh server, for example, so you have to get that info elsewhere. I've done that twice, and can say that unless you're already something of a Linux guru, it will be a struggle.

Bob Murphy
A: 

I would agree that setting up GIT on Windows is a lot of work - that said, Mysisgit is much more powerful than simply following the guide because of the extensions that are integrated into it which make it much more intuitive on Windows (TortiseGIT etc) - these are not available when using cygwin.

I second that if someone could write a guide it would be awesome as I tried and ended up giving up.

A: 

See this video tutorial.
http://www.youtube.com/watch?v=qkTa9JFspyc

Vereb
+5  A: 
ldigas
+2  A: 

hi - so far none of these posts actually answer Tom's question. None of the answered provided indicate how to actually setup a GIT SERVER

I think basically he is looking to setup SSH using Puttygen and Pagent and hook this into GIT to allow push/pull from a repository on the local PC and provide auth to other users. Personally, I have no experience with this - but this seems to be what is being requested.

Edit:Tim's post answers the question. Vote and select it as the answer.

Andy
A: 

So in your search you already found How to make msysgit installation a remote repository and 8 ways to share your git repository?

If you need really need gitosis, there are much more tutorials using Cygwin than using msysGit.

alexandrul
+32  A: 

I found this post and I have just posted something on my blog that might help.

See Setting up a Msysgit Server with copSSH on Windows. It's long, but I have successfully got this working on Windows 7 Ultimate x64.

Tim
Answer available via this post.
Andy
For the record, from what I can tell, at point 5.5 in Tim's instructions, you need to insert the extra command BEFORE the #, not after (otherwise it remains commented out).
Benjol
When checking to see if the bashrc is configured correctly by typing echo $HOME, the above guide advises you to use the export command if it doesn't give the correct directory. This will temporarily fix the problem but if you close the console and reopen it, echo $HOME shows the export didn't stick. Follow Benjol's advice in the above comment. This will fix the problem.
Rupert
A: 

I did what Bob Murphy suggested was the "hard" option.

I installed Ubuntu under VMWare Server (free) at work and then followed this guide on setting up Gitosis. I found it much easier than trying to get it going under Windows. Once it's set up you really don't have to touch it because Gitosis administration can be done from Windows by pushing updated versions of the gitosis.conf file. Any work I do need to do on the server directly is done via PuTTY so I don't have to use the horrible VMWare Server interface.

I've recently been messing around with VirtualBox at home and I've found it much nicer/easier to work with than VMWare Server, so it may be worth looking at that.

Jacob Stanley
+3  A: 

With regards to the reference to the Tim Davis page - Setting up a Msysgit Server with copSSH on Windows - I used this to get a Git server running on Windows 7 Home Premium 64.

Below is a postmortem/update of what I learned in addition to his instructions.

Like Tim Davis said, this was an arduous and frustrating process, at least for me - I'm not too good with integration of this sort, but I learned alot in the process. I hope my pain benefits someone else in the future, because this was an arduous process.

  1. There is a step to copy all the Git executables into your CopSsh bin directory. Instead of copying files and figuring out which files are needed, add the git bin path to your git path. I did so by modifying my .bashrc and CopSsh profile.

    Here's what I added to .bashrc (in your CopSsh and Windows home directory):

    gitpath='/cygdrive/c/Program Files (x86)/Git/bin'

    gitcorepath='cygdrive/c/Program Files (x86)/Git/libexec/git-core'

    PATH=${gitpath}:${gitcorepath}:${PATH}

    Here's what I added to the bash profile (in CopSsh etc/profile):

    gitpath='/c/Program Files (x86)/Git/bin'

    gitcorepath='cygdrive/c/Program Files (x86)/Git/libexec/git-core'

    export PATH="/bin:$syspath:$gitpath:$gitcorepath:$winpath"

    There is some duplication here - it works for me, so someone chime in which is the correct place to modify the path.

  2. The newer msysgit versions might not give you the screen to choose the ssh executable where you choose between the Git ssh and PuTTY ssh. You'll have to set GIT_SSH manually if you use PuTTY.

  3. I didn't follow one part of the instructions and that was installing Tortoise - I used the command line instead as that's how I prefer to learn a vcs like I did with rcs and Subversion and found that to work for me. I had problems with the clone command using ssh. Here's how I did it:

    http://stackoverflow.com/questions/2433049/git-clone-using-ssh-cant-find-repository/2434967#2434967

    This is where I banged my head the most.

  4. The CopSsh install directory was /Program Files (x86)/ICW. I got away with this, but if I were doing it again, I'd use a directory name with no spaces.

  5. These other sources helped me figure things out:

    Another way to setup a Git server on Windows:

    http://code.google.com/p/tortoisegit/wiki/HOWTO_CentralServerWindowsXP

    The client side of things:

    http://toolmantim.com/thoughts/setting_up_a_new_remote_git_repository

    An explanation of Git as a server (not related to Windows, but a more in depth look than installation steps):

    http://progit.org/book/ch4-0.html

    Plus O'Reilly's Version Control with Git - the Remote Repositories chapter.

In retrospect, if I had known how time consuming this would be, I might have started out with Mercurial as I read the install on Windows is easier, but I'll have an opinion on that after I work with Git awhile and then try Mercurial.

Steve
I'm having trouble with the CopSSH step. The link to CopSSH is not there anymore... I get directed to http://sourceforge.net/projects/sereds/files/ where I can only download cwRsync_4.0.4_Installer.zip instead of the CopSSH installer. Any suggestions?
Teef L
This is the link I used: http://www.itefix.no/i2/node/27
Steve