13

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.

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.

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?

whyoz
  • 5,168
  • 47
  • 53
  • 1
    With Jira/Stash, why not use SourceTree? They go together. Forget about Xcode's git "support"; it's terrible. – matt Nov 04 '15 at 16:58
  • When you work with Android Studio, VS 2015 (TFS and Git), Xcode, Adobe Master Collection, and countless other UIs everyday, you just expect Apple to "figure it out" instead of having another window open in some dark corner of my Parallels...that's why... – whyoz Nov 05 '15 at 05:53
  • 1
    When you've tried to use Xcode's crappy source control interface for as long as I have - and given up every time - you don't expect Apple to figure it out. – matt Nov 05 '15 at 16:42
  • 2
    my workaround is to drop into a terminal and `git pull` – mikebob Nov 23 '15 at 16:29

2 Answers2

19

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

1) Create your branch in Jira/Stash

2) In Xcode, go to Source Control

3) Select "Pull"

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

5) select the new branch and pull

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

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

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.

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

whyoz
  • 5,168
  • 47
  • 53
  • 1
    Thanks, this technique (pull) worked for me. But I enabled "Refresh server status automatically" and the list to switch to a branch still wasn't updating, so I don't know how reliable that is. Supposedly source control in Xcode 9 is vastly improved and is now integrated tightly with GitHub (they've been working with them directly). I hope so because git and Xcode have always had issues for me with every version of Xcode. We shall see. – Ben Stahl Jun 26 '17 at 18:39
16

Now you need to tick Fetch and Refresh Status

enter image description here

Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87
  • 1
    Apple made it easier didn't they..thx for updating this! This is now the accepted answer – whyoz Nov 29 '18 at 06:11
  • I have some stashed changes in my local machine and the new branch is not reflecting in my list If I performed fetch it will list it out but I dought it will not remove my stashed changes. Is anyone tackle the same scenario before? – Akshay Digrase Jun 28 '19 at 06:43