Visual Studio/GIT:没有跟踪的远程分支 [英] Visual studio/GIT : No tracked remote branch

查看:896
本文介绍了Visual Studio/GIT:没有跟踪的远程分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚为Visual Studio 2015配置了与GitHub的连接.不幸的是,跟踪远程分支无效. 我在同一解决方案中有2个项目,每个项目都有自己的存储库. 对于他们每个人, -我只有一个分行(Master) -我检查了远程分支的设置是否正确(推"和取"具有相同的值).我最终重置了分支 -在同步中,仅获取"未变灰.单击它不会同步.在传入的提交"下写有当前分支未跟踪远程分支". -使用Git GUI时,它可以正常工作,我可以轻松地获取和推送.

I just configured Visual Studio 2015 with a connection to GitHub. Unfortunately, it doesn't work to track the remote branch. I have 2 projects in the same solution, each has its own repository. For each of them, - I only have one branch (Master) - I checked that the remote branch was set correctly (Push and fetch have the same value). I eventually reset the branches - In Synchronization, only "Fetch" is not greyed out. Clicking on it doesn't synchronize. Under "Incoming Commit" is written "The current branch does not track a remote branch". - When working with Git GUI, it works fine, I can easily fetch and push.

请询问是否需要更多信息.

Please ask if you need more information.

谢谢

Niko

推荐答案

UI并未明确表明必须使用Publish而不添加远程仓库.

The UI doesn't make it very clear that you have to use Publish without adding a remote repo.

如果首先添加远程,则发布将永远不可用,并且会陷入不跟踪远程分支"状态.我在VS2017中遇到了同样的麻烦.

If you add a remote first, Publish never becomes available and you get stuck in the "does not track a remote branch" state. I've just had the same trouble in VS2017.

错误的方式:

您可能会认为,必须先告诉Visual Studio有关该遥控器的信息,然后才能同步到该遥控器.不要那样做.

You might think that before you can sync to a remote, you have to tell Visual Studio about the remote. Don't do that.


正确的方法:

相反,点击同步":

Visual Studio检测到没有为该仓库配置任何远程服务器,并带您进入推送"对话框:

Visual Studio detects that there is no remote configured for the repo, and takes you to the Push dialog:

按相关的发布"按钮,出现一个输入框.在此处使用远程仓库的URL配置Visual Studio的正确位置.

Press the relevant Publish button, and an input box appears. This is the right place to configure Visual Studio with the URL of the remote repo.

以这种方式添加远程服务器后,Visual Studio会识别远程存储库的状态,因此它不再认为它是未跟踪的.从现在开始,它将按预期启用所有同步/推送功能.

When the remote is added this way, Visual Studio recognizes the status of the remote repo so that it no longer thinks it's untracked. From now on, it enables all the sync/push functionality as expected.

这篇关于Visual Studio/GIT:没有跟踪的远程分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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