Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 克隆分支机构并将其推入私人回购_Git_Github - Fatal编程技术网

Git 克隆分支机构并将其推入私人回购

Git 克隆分支机构并将其推入私人回购,git,github,Git,Github,我有权获得一份5人共享的私人回购协议。 我做了一个测试 git clone https://github.com/thecompany/theprogram.git 然后,我创建了一个新分支,并尝试使用以下命令推送它: git push --set-upstream the-new-branch 但我有一个错误: remote: Repository not found. fatal: repository 'https://github.com/thecompany/theprogram.

我有权获得一份5人共享的私人回购协议。 我做了一个测试

git clone https://github.com/thecompany/theprogram.git
然后,我创建了一个新分支,并尝试使用以下命令推送它:

git push --set-upstream the-new-branch
但我有一个错误:

remote: Repository not found.
fatal: repository 'https://github.com/thecompany/theprogram.git/' not found

如何将我的分支推到github上

克隆成功后,请尝试此操作

首先,签出一个新分支:

git checkout -b  the-new-branch
然后,推送到远程原点(默认):

并且,设置为上游:

git branch --set-upstream-to=origin/the-new-branch
我的期望是能够推送到我可以克隆的私有回购,但也无法推送分支

这取决于“无法推动分支”的含义

如果它是原始问题中的“未找到存储库”,则表示推送时用于身份验证的凭据(可能已缓存)不正确。
首先测试git ls远程https://@github.com/是否工作

如果是“权限被拒绝”问题,则可能不够高(即:“读取”或“分类”将允许克隆,而不是推送)


OP在评论中确认:他只有阅读权限。

@lost9123193在哪里可以解决这个问题?是的,通过无法推动分支,我指的是原始问题。我已尝试从osxkeychain清除凭据。在执行ls remote时,我会按照您的建议直接列出包含和不包含存储库的远程分支的列表。我倾向于一个权限被拒绝的问题,但是如果
remote:Repository-not-found,这会不会回来。
@GarrettBarlocker您使用的是以
开头的HTTPS URL还是SSH URLgit@github.com:…
?是的,当您没有足够的权限时,“找不到”是一个经典的答案:安全措施,为了不泄露您试图访问的远程存储库,我使用的是HTTPSURL@GarrettBarlocker好的,如果您可以克隆,那么这不是凭证问题。保留权限级别:您是如何添加到该私有存储库的?有哪些权利?
git branch --set-upstream-to=origin/the-new-branch