克隆一个分支并将其推送到私有仓库中

los*_*193 5 git github

我获得了访问 5 人共享的私人仓库的权限。我做了一个

git clone https://github.com/thecompany/theprogram.git
Run Code Online (Sandbox Code Playgroud)

然后我创建了一个新分支并尝试使用以下方法推送它:

git push --set-upstream the-new-branch
Run Code Online (Sandbox Code Playgroud)

但我收到一个错误:

remote: Repository not found.
fatal: repository 'https://github.com/thecompany/theprogram.git/' not found
Run Code Online (Sandbox Code Playgroud)

如何将我的分支推送到 github?

小智 1

当你克隆成功后,试试这个

首先,签出一个新分支:

git checkout -b  the-new-branch
Run Code Online (Sandbox Code Playgroud)

然后,推送到远程源(默认):

git push origin the-new-branch 
Run Code Online (Sandbox Code Playgroud)

并且,设置上游:

git branch --set-upstream-to=origin/the-new-branch
Run Code Online (Sandbox Code Playgroud)