Xcode 7 不使用 Git 显示新的远程分支

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33527579/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:10:00  来源:igfitidea点击:

Xcode 7 doesn't show new remote branches using Git

iosxcodegitjira

提问by whyoz

In Xcode 7, after creating a new remote branch using Jira/Stash, when I pull master, the new branch used to show up as an optional origin branch. Now newer branches don't show up at all, so creating a new local branch isn't as easy.

在 Xcode 7 中,使用 Jira/Stash 创建一个新的远程分支后,当我拉主时,新分支过去常常显示为可选的原始分支。现在新的分支根本不会出现,所以创建一个新的本地分支并不容易。

Before you could go to Source Control > hover over your current working copy > select "Switch to Branch" and scroll to see the new origin/ branch. Once that was selected, Xcode automatically created a local branch.

在您可以转到源代码管理 > 将鼠标悬停在当前工作副本上 > 选择“切换到分支”并滚动以查看新的源/分支之前。选择后,Xcode 会自动创建一个本地分支。

Now I have to manually name/create a new branch locally and push it up (Create) the remote branch which can cause a lot of conflicts if you're working copy isn't master.

现在我必须在本地手动命名/创建一个新分支并将其推送(创建)远程分支,如果您的工作副本不是主分支,这可能会导致很多冲突。

Is there a way to force Xcode to see all the remote branches via the Terminal, or by something I'm missing in Xcode?

有没有办法强制 Xcode 通过终端查看所有远程分支,或者我在 Xcode 中缺少的东西?

采纳答案by Sh_Khan

Now you need to tick Fetch and Refresh Status

现在您需要勾选获取和刷新状态

enter image description here

在此处输入图片说明

回答by whyoz

Ok, so as of Xcode 7.1.1, it looks like the way to do this is to:

好的,从 Xcode 7.1.1 开始,看起来这样做的方法是:

1) Create your branch in Jira/Stash

1) 在 Jira/Stash 中创建你的分支

2) In Xcode, go to Source Control

2) 在 Xcode 中,转到源代码管理

3) Select "Pull"

3)选择“拉”

4) Click on the dropdown and you'll see the new "origin/..." branch

4) 点击下拉菜单,你会看到新的“origin/...”分支

5) select the new branch and pull

5)选择新分支并拉取

6) go to Source Control, hover over your working copy, and select "Switch to Branch..."

6)转到源代码管理,将鼠标悬停在您的工作副本上,然后选择“切换到分支...”

7) find the new origin branch in the origin section and you'll create a new local branch

7) 在 origin 部分找到新的 origin 分支,你将创建一个新的本地分支

Some IDEs like Visual Studio may require you to pull "master" to get the new origin branches, but this seems to be the way it's done now in Xcode.

一些像 Visual Studio 这样的 IDE 可能需要你拉“主”来获取新的原始分支,但这似乎是现在在 Xcode 中完成的方式。

UPDATE:It appears I didn't have "Refresh server status automatically" checked which would eliminate most of these steps! (found in Xcode -> Preferences -> Source Control .. unless this was recently added in Xcode 7.3) enter image description here

更新:看来我没有检查“自动刷新服务器状态”,这将消除大部分这些步骤!(在 Xcode -> Preferences -> Source Control .. 中找到,除非最近在 Xcode 7.3 中添加) 在此处输入图片说明