用GitHub for Windows发布分支失败,没有上游分支 [英] Publishing branches with GitHub for Windows fails with no upstream branch

查看:707
本文介绍了用GitHub for Windows发布分支失败,没有上游分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用Github for Windows发布新本地分支时,该过程失败,但没有错误消息。打开shell并使用'git push'会导致错误:

  fatal:当前分支local-branch-name没有上游分支
要推送当前分支并将远程设置为上游,请使用

git push --set-upstream origin local-分支名称

如果我剪切并粘贴此命令,则会继续前进,我可以使用GUI所有其他推拉。我一直在使用GitHub for Windows一年多,而这一切都刚刚开始。我最近升级了,并且正在运行 Great Dane 2.6.4.1 版本。我不知道这是否有任何相关性。我没有看到很多报告或者真的有这类问题的报道。

我是否在某处设置了一个导致此问题的标志? GitHub默认更改了吗?什么可能导致这种行为? (我完全认为这是一个PEBKAC问题,我只是不知道我做了什么)。

解决方案

您需要调用特定的上游设置或设置默认的上游设置。

  $ git branch --set-upstream-to = origin / master 
$ git remote -v
origin https://github.com/ mjbrender / simple-blog.git(fetch)
origin https://github.com/mjbrender/simple-blog.git(推送)

如果您还没有设置:

  $ git remote add上游git@github.com/some-maintainer/some-project.git 

你可以保持自己在使用此项目克隆项目后再次遇到这个问题:

  $ git config --global push.default simple 


When I try to publish a new local branch using Github for Windows the process fails without an error message. Opening the shell and using 'git push' results in the error:

fatal: The current branch local-branch-name has no upstream branch
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin local-branch-name

If I cut and paste this command the push goes forward and I can use the GUI for all other pushes and pulls. I have been using GitHub for Windows for more than a year and this just started. I recently upgraded and I am running version Great Dane 2.6.4.1. I don't know if that has any relevance or not. I am not seeing a lot of reports or really any reports of this type of issue.

Did I set a flag somewhere that is causing this? Did a GitHub default change? what could be causing this behaviour? (I fully expect this to be a PEBKAC issue I just don't know what I did).

解决方案

You either need to call a specific upstream or set a default upstream setting.

 $ git branch --set-upstream-to=origin/master
 $ git remote -v
       origin   https://github.com/mjbrender/simple-blog.git (fetch)
       origin   https://github.com/mjbrender/simple-blog.git (push)

If you don't have one set yet:

$ git remote add upstream git@github.com/some-maintainer/some-project.git

You can keep yourself from having to this again after a project clone with this:

$ git config --global push.default simple

这篇关于用GitHub for Windows发布分支失败,没有上游分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆