简体   繁体   English

私有存储库的 git clone 错误

[英]Error in git clone of a private repository

I'm trying to clone a private repository.我正在尝试克隆一个私有存储库。 I have tried with 2 ways我尝试了 2 种方式

  1. Using Android Studio使用 Android Studio

Result结果在此处输入图片说明

  1. Using CMD使用 CMD

Result结果

C:\thoughtcast>git clone https://github.com/thoughtcastapp/git.android.ThoughtCast.git
Cloning into 'git.android.ThoughtCast'...
remote: Repository not found.
fatal: repository 'https://github.com/thoughtcastapp/git.android.ThoughtCast.git/' not found

Screenshot to verify the repo验证回购的屏幕截图

在此处输入图片说明

How do I access my private repository?如何访问我的私人存储库?

There can be multiple causes for this error.此错误可能有多种原因。 Try following in the order mentioned尝试按照提到的顺序进行操作

  1. Include your username in the repo url在 repo url 中包含您的用户名
git clone https://username@github.com/thoughtcastapp/git.android.ThoughtCast.git/
  1. Identify remote git repository to your terminal.将远程 git 存储库识别到您的终端。
git remote set-url origin https://github.com/thoughtcastapp/git.android.ThoughtCast.git/
  1. Uninstall the git credentials manager and reinstall (for cmd, run as administrator)卸载git凭据管理器并重新安装(对于cmd,以管理员身份运行)
$ sudo git credential-manager uninstall
$ sudo git credential-manager install
  1. If repo has been created by another user, check if you have read-write access.如果 repo 是由其他用户创建的,请检查您是否具有读写访问权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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