[ACCEPTED]-How can I make my local repository available for git-pull?-working-copy

Accepted answer
Score: 139

Five possibilities exist to set up a repository 7 for pull from:

  • local filesystem: git clone /path/to/repo or git clone file://path/to/repo. Least work if you have networked filesystem, but not very efficient use of network. (This is almost exactly solution proposed by Joakim Elofsson)
  • HTTP protocols: git clone http://example.com/repo. You need any web server, and you also need to run (perhaps automatically, from a hook) git-update-server-info to generate information required for fetching/pulling via "dumb" protocols.
  • SSH: git clone ssh://example.com/srv/git/repo or git clone example.com:/srv/git/repo. You need to setup SSH server (SSH daemon), and have SSH installed on client (e.g. PuTTY on MS Windows).
  • git protocol: git clone git://example.com/repo. You need to run git-daemon on server; see documentation for details (you can run it as standalone process only for fetching, not necessary run as service). git-daemon is a part of git.
  • bundle: You generate bundle on server using git-bundle command, transfer it to a client machine in any way (even via USB), and clone using git clone file.bndl (if clone does not work, you can do "git init", "git remote add" and "git fetch").

What you are missing in your 6 example is probably running git-daemon on 5 server. That, or misconfiguring git-daemon.

Unfortunately 4 I cannot help you with running git-daemon 3 as service on MS Windows. There is nothing 2 in announcement for last version of msysGit 1 about git-daemon not working, though.

Score: 19

In addition to Jakub Narębski's answers, there 6 is anotherway, more in-line with your original 5 question. You could clone from github like 4 you usually do, then when you want to perform 3 a one-off pull from your local repo, just 2 do this:

git pull /path/to/repo master

(instead of master you can put any 1 branch name.)

Score: 2

If you have a path like


and you did git init already, so 7 you also have a folder


You now make a new 6 folder


Go into that folder and run git clone --bare ..\Project (bare is 5 important),
go back to your C:\Project\ folder and 4 do a git remote add-url local ..\.git\Project.
Now you just do git add -A, git commit -m "HelloWorld" and git push local master.

You may share 3 the Project folder, connect it to Z: and do git clone Z:\Project - you 2 can use now git pull origin master and git push origin master to push/pull changes from 1 one computer to another.

Score: 1

The ssh route works well but does require 5 a remote ssh server. If you have Windows 4 platform then Cygwin provides a working 3 ssh server that works with Git, but manually 2 upgrade Git if using Cygwin Git (I wrote 1 some hints at http://alecthegeek.wordpress.com/2009/01/21/top-tip-upgrade-git-on-cygwin/).

Score: 1

I recently changed one of my git projects 14 to replicate itself to an HTTP server using 13 sitecopy to do the actual file uploads.

It's 12 pretty easy, just use git update-server-info then mirror the .git 11 directory to some http-accessible directory 10 on your server. I used 'project.git', which 9 is fairly common.

Git pull from http://site/project-git works like 8 a champ, and I don't have to have anything 7 on the server except FTP access, though 6 sitecopy supports webdav as well.

I don't 5 recommend using sitecopy, however, as it 4 doesn't keep multiple machines in sync well. For 3 my project, the HTTP repository is readonly, and 2 gold updates come from just one machine, so 1 it works well enough.

Score: 0

If your remote host is in the same windows 5 network, i.e. you can access it as \remotehost, then 4 you can map network drive in explorer, let's 3 say z: --> \remotehost\repodir, after that 2 you can use 'git clone /z/myproject' to 1 clone project

More Related questions