106

I am having trouble finding the menu item to switch branch using Xcode 9. The working copies menu seems to have disappeared. Any ideas?

Xcode 9

enter image description here

Xcode 8

enter image description here

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Alexander MacLeod
  • 2,026
  • 3
  • 14
  • 22
  • 1
    There's a new source control navigator button beside the project navigator button that might be intended for some use but all it tells me is "Loading...". – Phillip Mills Jun 06 '17 at 18:48
  • You could review [Apple Session](https://developer.apple.com/videos/play/fall2017/204/)... – Ahmad F Oct 29 '17 at 06:31

5 Answers5

180
  • Press ⌘2 to open the new Source Control Navigator.
  • Right-click on the master icon.

enter image description here

To switch to a different branch

  • Right-click on a non-current branch
  • Choose Checkout...
  • Press or click on the Checkout button.

enter image description here

vadian
  • 274,689
  • 30
  • 353
  • 361
  • 7
    Yes, but you see there is no "Switch to Branch…" in that contextual menu, as there was in earlier Xcodes. In Xcode 9, you use "Checkout…" (which will be enabled when you select any non-current branch). I like this, because the terminology now matches the git command line command you would use. – Jerry Krinock Jun 13 '17 at 17:57
  • It takes time to find the branch from Remotes. Do you know the way to search remotes brand with Name? – Liem Vo Oct 03 '17 at 03:58
  • I'm afraid I don't know a way. – vadian Oct 03 '17 at 17:23
  • In the repo I'm working in there are yellow folders within the branch names. This dev team has yellow folders with app version numbers for the folder names then branches inside those folders. How did they do that? https://i.imgur.com/zKoWxD6.png – Edison Jul 31 '18 at 05:40
17

Expose the left side window (Navigator) in your Xcode by selecting this option (you will see this on the top right side of your Xcode window):

Enabling the Navigator

Now select the second tab:

Selecting the Source control tab

Right click on the branch you are intending to checkout and hit the checkout button from menu: Checking out the branch

Rushabh
  • 651
  • 5
  • 15
16

It seems that Apple has moved Source Controls feature like change branch, version history to separate tab in Navigator area for Xcode 9.x

Below are step to perform branch switch :

  1. Open the Navigator area (if it is hidden) by pressing left pane window present on top right of Xcode or use shortcut cmd + 2

step1

  1. In Source control navigator you can see Branches, Tag present for your project.

Step2

  1. Now, if you want to switch branch then select the branch to switch and right click on it.

  2. Select Checkout. This will prompt an alert Do you want to check out “<branch name>”? Select Checkout.

Step3-4

  1. Now this will switch your branch to selected one after sometime.

Note: In order to switch between branches you need to commit or discard changes done in project.

Step5

Step6

  1. You can even see Log history by selecting branch. Commit history can be viewed based on last 24 hours, last 7 days and last 30 days.

Step 6

Step 7

Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177
2

1) Press show navigator button (top right corner of Xcode):

enter image description here

2) Show the project navigator, expand Remotes folder:
enter image description here

3) Expand the origin folder, right click the branch you want to use, and click Checkout....
enter image description here

Josh O'Connor
  • 4,694
  • 7
  • 54
  • 98
0

Follow the below link for the clear explanation of each and every functionality like, Commit, pull, push, etc.

https://www.raywenderlich.com/153084/use-git-source-control-xcode-9

Teja Kumar Bethina
  • 3,486
  • 26
  • 34