gpt4 book ai didi

git - 克隆分支并将其推送到私有(private)仓库中

转载 作者:行者123 更新时间:2023-12-03 16:51:33 26 4
gpt4 key购买 nike

我被授予访问 5 人共享的私有(private)仓库的权限。
我做了一个

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 上?

最佳答案

Expectation is to be able to push to a private repo that I am able to clone, but unable to push a branch too.


这取决于“无法将分支推送到”的含义。
如果它是原始问题中的“未找到存储库”,则表示推送时用于验证的凭据(可能已缓存)不正确。
首先测试 git ls-remote https://<you>@github.com/<user-or-org>/<private-repo>作品。
如果是“权限被拒绝”问题, permission level可能不够高(即:“读取”或“分类”将允许克隆,而不是推送)
OP 在评论中确认:他只有读取权限。

关于git - 克隆分支并将其推送到私有(private)仓库中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54190708/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com