Creating a simple remote git repository

This is for hosting git on a Windows filesystem. Suppose you have a mapped network drive ‘M:’, then

cd /d M:\git
mkdir myrepo.git
cd myrepo.git
git init --bare

Then get a local working copy, e.g.

cd /d C:\temp\git
git clone M:\git\myrepo.git

However you need to actually put something into the repo, including the master branch (implicit in this case):

cd myrepo
echo "Readme" > readme.md
git add .
git commit -m'Initial commit'
git push origin master

And that’s all you need to do. You now have a git repo on your network drive.

Git supports the file:// protocol so you can repeat the cloning part as follows:

cd /d C:\temp\git
git clone file:////yourserver/dvcs/git/myrepo.git
cd myrepo
echo "Readme" > readme.md
git add .
git commit -m'Initial commit'
git push origin master