Just installed git on Windows. I set the GIT_DIR variable to be c:\\git\\ and verified that this environment variable is maintained by cygwin (i.e. echo $GIT_DIR is what it
Create a bare GIT repository
A small rant: git is unable to create a normal bare repository by itself. Stupid git indeed.
To be precise, it is not possible to clone empty repositories. So an empty repository is a useless repository. Indeed, you normally create an empty repository and immediately fill it:
git init
git add .
However, git add is not possible when you create a bare repository:
git --bare init
git add .
gives an error "fatal: This operation must be run in a work tree".
You can't check it out either:
Initialized empty Git repository in /home/user/myrepos/.git/
fatal: http://repository.example.org/projects/myrepos.git/info/refs not found: did you run git update-server-info on the server?
git --bare init
git update-server-info # this creates the info/refs file
chown -R : . # make sure others can update the repository
The solution is to create another repository elsewhere, add a file in that repository and, push it to the bare repository.
mkdir temp; cd temp
git init
touch .gitignore
git add .gitignore
git commit -m "Initial commit"
git push (url or path of bare repository) master
cd ..; rm -rf temp
hope this can help u