I am trying to create a local git server, that i will then clone and use it on my same machine.
I read this stackoverflow answer:
How to add a local repo and treat it as a remote repo
If your goal is to keep a local copy of the repository for easy backup or for sticking onto an external drive or sharing via cloud storage (Dropbox, etc) you may want to use a bare repository. This allows you to create a copy of the repository without a working directory, optimized for sharing.
$ git init --bare ~/repos/myproject.git $ cd /path/to/existing/repo $ git remote add origin ~/repos/myproject.git $ git push origin master
So i went ahead in my D drive and done the following:
- Created a
gitserver.git folder
with the .git extension, its a folder. - Ran
$ git init --bare
after i right clicked that folder and selected gitbash - Created another folder inside the root D drive called gitclient.
- Right clicked inside gitclient and selected gitbash and tried to run
git remote add origin D:/gitserver.git
Did not work i am getting
$ git remote add origin D:/gitserver.git
fatal: not a git repository (or any of the parent directories): .git
It probably has to do with the path.
If somebody posts an answer, please describe how to work with windows paths in gitbash, everybody thinks that linux is the only OS when dealing with git.