3

I currently have a setup where on my windows machine with cygwin I added my linux server as a remote origin where I can then push my changes as I have my SSH keys configured.

git add remote origin ip@path.git
git push origin

How would I do this to my windows machine is it as simple as hosting an SSH server and if so which do you recommend?

Mark Longair
  • 446,582
  • 72
  • 411
  • 327
user391986
  • 29,536
  • 39
  • 126
  • 205

4 Answers4

8

It sounds as if you want be able to push to the repository on a Windows machine, so git daemon and the git protocol won't be enough for you. If you need to be able to push to the repository you're left with these options:

  1. Run an SSH server on your Windows box. There are various guides you can find for doing this with Cygwin, e.g. this one or this one. An alternative is to use mSysGit, in which case you could chase the references in this Stack Overflow question: Setup a Git server with msysgit on Windows
  2. Use git's "Smart HTTP" protocol - sdorra's answer implies that SCM-manager lets you do this, but I've no experience of that. However, Smart HTTP is essentially just provided by a binary called git-http-backend that you can use over CGI. This binary is distributed in mSysGit, so you could set that up with a web server - for example, there's a tutorial on doing that with Apache here

Another alternative is to mount your remote computer as a local drive and add it as a remote using the file: protocol.

Community
  • 1
  • 1
Mark Longair
  • 446,582
  • 72
  • 411
  • 327
  • 1
    The last alternative worked for me you mentioned. Mapping a drive to the Windows server (from a Mac), and then init a bare repo on the mapped windows drive ('git init --bare'), then saying "git remote add REMOTEBRNAME file://PATHTOMAPPEDDRIVE" on local repo. Works like a charm to 'git push REMOTEBRNAME', does as expected. Git deploy. Sweeeeeeeet. – program247365 Apr 19 '12 at 12:44
1

You can use git daemon. Hosting Git Repository in Windows

Community
  • 1
  • 1
Mohamed Mansour
  • 39,445
  • 10
  • 116
  • 90
1

Or you could use SCM-Manager and do the push or pull over http.

sdorra
  • 2,382
  • 18
  • 16
0

You could use Gitblit, an open-source, integrated, pure Java Git server, viewer, and repository manager for small workgroups. It works well on Windows and includes tools to run as a Windows service.

James Moger
  • 1,721
  • 12
  • 12