Xcode 11 Version Control Changes

October 19th, 2019

Filed under: Version Control, Xcode | Be the first to comment!

This post lists all the changes I found in Xcode 11 on version control.

Code Review Button

Xcode 11 adds a code review button to the toolbar that lets you view the changes you made to the currently selected file.

CodeReviewButton

The code review button is the button with the two arrows facing right and left.

Discarding Changes Using the Editor

When you make changes to your source code, a blue bar appears on the left side of the editor next to the changed code.

SeeVersionControlChangesInEditor

If you click the blue bar, a popover opens that lets you discard the change you made to that block of code.

Stashing Changes

In Xcode 11 you can stash uncommitted changes in Xcode. Stashing changes lets you temporarily store changes you make to your code so you can switch branches. Stashing is potentially dangerous. If you mistakenly remove a stash, you can’t get it back. It’s safer to create a temporary branch and commit your changes to the temporary branch.

Choose Source Control > Stash Changes to stash your changes. A sheet opens for you to enter an optional message. Click the Stash button to complete the stash.

You can view your stashes from the source control navigator. The stashes are in the Stashed Changes folder. Select a stash to view the changes you made.

ViewStashes

Right-clicking on a stash opens a contextual menu that lets you apply and delete your stashes.

Cherry Picking

Xcode 11 adds support for cherry picking commits. Cherry picking involves taking a commit from one git branch and applying it to another.

To cherry pick a commit, switch to the branch where you want to apply the cherry pick. Choose Source Control > Cherry Pick.

CherryPickSheet

A sheet opens for you to enter a revision identifier, which is the identifier git supplies for a commit. Finding the revision identifier for the commit you want to cherry pick is the hardest part. When you enter a valid identifier, the commit will appear in the list of commits. Select the commit and click the Cherry-Pick button to cherry pick the commit.

Tags:


Leave a Reply

Your email address will not be published. Required fields are marked *