-
Notifications
You must be signed in to change notification settings - Fork 1
Git Using File Share
This assumes git and git tools (differ, merger) are configured. If not, see Git - General Prerequisites
C:\> mkdir MyRepos
C:\> cd MyRepos
C:\MyRepos>
We'll assume that \\fserver\r is an empty file share. And we're going to create a directory in there call mygame.git. The .git extension on the directory is not necessary but is a nice convention to remind yourself later that the folder contains a git repository. Create directory \\fserver\r\mygame.git:
mkdir \\fserver\r\mygame.git
Use the pushd
command to simultaneously map a drive and CD to the folder:
pushd \\fserver\r\mygame.git
Now create a bare repository and return
git init --bare
popd
C:\MyRepos> git clone file:////fserver/r/mygame.git
Cloning into 'mygame'...
warning: You appear to have cloned an empty repository.
C:\MyRepos> cd mygame
C:\MyRepos\mygame>
That's it. Add, Commit, Push and pull as desired.
C:\> mkdir MyRepos
C:\> cd MyRepos
C:\MyRepos> mkdir mygame
C:\MyRepos> cd mygame
C:\MyRepos\mygame>
C:\MyRepos\mygame> git init
Initialized empty Git repository in c:/MyRepos/mygame/.git/
C:\MyRepos\mygame> echo. > readme.md
C:\MyRepos\mygame> git add -A
C:\MyRepos\mygame> git commit -m "First Commit"
[master (root-commit) a8a02c1] First Commit
1 file changed, 1 insertion(+)
create mode 100644 readme.md
We'll assume that \\fserver\r is an empty file share. And we're going to create a directory in there call mygame.git. The .git extension on the directory is not necessary but is a nice convention to remind yourself later that the folder contains a git repository. Create directory \\fserver\r\mygame.git:
mkdir \\fserver\r\mygame.git
Use the pushd
command to simultaneously map a drive and CD to the folder:
pushd \\fserver\r\mygame.git
Now create a bare repository and return
git init --bare
popd
C:\MyRepos\mygame> git remote add origin file:////fserver/r/mygame.git
C:\MyRepos\mygame> git push --set-upstream origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 203 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To file:////fserver/r/mygame.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
That's it. Add, Commit, Push and pull as desired.