I have a git repo hosted with bitbucket and i have a clone on my home directory and i was thinking of cloning another inside /var/www directory.When i try cloning another copy into my www folder i get this error
Cloning into 'php'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
There is nothing wrong with my public key since i can push changes to bitbucket from the cloned repo i have on the home folder and i can see the latest commits i have made on the bitbucket website.
Is there a known explanation for this behavior?.
I don’t think that you need to clone the repository into the /var/www. I think that the best solution is to create a symbolic link of the repository into the /var/www. That way you don’t need to synchronize two repositories.
But if want to create another repository into the /var/www directory, you need to give permission to your user to write in the directory or create a new publickey for your root user and copy it to the bitbucket.