简体   繁体   中英

Cloning Git repository locally

I have just create a git repository on my iMac under the user git account and am now want to clone it from my main user account on the same computer. I have created my SSH key and added it to the.ssh/authorized_keys file. However when I log back in with my main account I get the following error message:

Permission denied (publickey) fatal: The remote end hung up unexpectedly

Now to me, and while searching on the web it seems like my public key is incorrect. I have created it twice and still get the same issue.

You shouldn't need an ssh key at all. Make all of the files world readable and just clone the full path. In other words, do

$ git clone /path/to/repo
git clone /path/to_repository  /path/to_where_you_want_it_cloned

确保您的主要用户帐户具有复制到帐户目录或从帐户目录复制的权限。

One additional point is that if you created the git repo and did a git init -bare , you use a.git extension, but you do not need this on the folder name (when cloning it on the same machine).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM