如何将分叉仓库上创建的分支添加到上游仓库?

时间:2016-11-21 20:28:54

标签: git github version-control mercurial git-branch

我正在将我的修补程序分支从Mercurial迁移到Git。我使用hg-git插件将我的修补程序分支导入到我的git项目的forked repo上的新分支中。有没有办法将新创建的分支添加到上游仓库?上游仓库中目前不存在该分支。

我试着跑......

git push u git@git.<name of upstream repo>.git hotfix

但得到了错误......

error: src refspec git@git.<name of upstream repo> does not match any
error: failed to push some refs to 'u'

1 个答案:

答案 0 :(得分:1)

您应该使用-u代替u。您可以尝试以下命令:git push -u origin hotfix

注意: origin是remote的默认短名称。您可以使用git remote -v检查您的远程短名称是否来源。