I want to achieve a private repo where multiple users can work on online as well as offline. I have managed to install a repository on my webserver using ssh with putty. Now i tried to clone the repo locally to the local working environment.
I used gitbash in the directory I wanted to work in (under windows 7).
I used the following command:
$git clone user@myhost:folder/folderOfRepo
I got asked for my password. After I entered it I got this message:
"fatal:folder/folderOfRepo does not appear to be a git repository
"fatal:could not read from remote repository
Please make sure you have the correct access rights and the repository exists."
First question: is my overall approach correct for achieving what I want? If the answer is yes, then my second question is: what am I doing wrong that the repository won't clone?
I solved the problem using a / before the root folder, I used git clone user@myhost:/folder/folderOfRepo and it cloned my repo
Now I made some changes to the files inside the repo I've cloned, and used
git push
and get the following error:
remote: error: refusing to update checked out branch: refs/heads/master By default updating the current branch in a non-bare repository is denied, because it will make the index and work tree inconsistent.
I don't understand what is going wrong and why?