lokesh malla
lokesh malla

Reputation: 1

Does cloning repository mean that we will upload files of the repository

$ git clone /path /to/repository

fatal: could not create leading directories of 'C:/Program Files/Git/to/repository': Permission denied

Upvotes: 0

Views: 118

Answers (2)

VonC
VonC

Reputation: 1324407

could not create leading directories of 'C:/Program Files/Git/to/repository':

It looks like you were in C:/Program Files/Git when you tried to clone a repo.

Don't: go to a folder where you have the right to write without any privilege elevation.

cd %USERPROFILE%
git clone /a/repo/url/myrepo

No need to add a path as a second argument: by default, git clone will create a 'myrepo' folder (based on the name of the cloned repo) in the current folder (and will download then checkout the content of that remote repo to the newly created local folder).

That is why the current folder, in which you are executing a git clone, does matter.

Upvotes: 0

CodeWizard
CodeWizard

Reputation: 142114

Does cloning repository means that we will upload files of the repository

Vice cersa, clone means that you download the repository to your machine.
Look like you did not set up ssh keys on your server to be able to connect to it.

git-clone - Clone a repository into a new directory

assuming you are using github (or simply modify the steps based upon your git server)

Issue on adding SSH key to GitHub

Upvotes: 1

Related Questions