1

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?

cowgirl
  • 51
  • 3

1 Answers1

0

I think you need to set up your authentication with git. Checkout this link for setting up to clone with https. Then,git clone https://yoururl.com/user/reponame.git

AgileDan
  • 361
  • 1
  • 2
  • 21
  • 1
    What does Github have to do with the OP's question? He's hosting the git himself. – Magnus Bäck Aug 25 '14 at 17:32
  • 1
    I've enabled ssl so I can use a https link. However I did notice I can't access any folders, only files. Does this have anything to do with permissions and how do I change them? – cowgirl Aug 29 '14 at 11:22
  • You need to have a group with users (yourself included) with proper permissions. Have a look at this link: http://stackoverflow.com/questions/3242282/how-to-configure-an-existing-git-repo-to-be-shared-by-a-unix-group – AgileDan Aug 29 '14 at 15:26
  • For multiple users, do I need to make multiple users in git, or is it possible to use the same user on multiple devices? – cowgirl Sep 01 '14 at 09:43