Show changes in the source editor

You can use the change bar, that appears in the gutter of the source editor, to view changes, discard changes, and find out who made conflicting changes. First, enable the change bar and optionally, include upstream changes in preferences.

The style and color of the bars indicate the type of changes:

Color and style

Description

Solid blue

Uncommitted local changes

Solid gray

Committed (but not pushed) local changes

Outline blue

Upstream changes

Solid red

Upstream and local changes conflict

Enable the change bar

  1. Choose Xcode > Preferences, then click Source Control.

  2. Under General, in the Text Editing section, click “Show Source Control changes.”

    If you make changes to your file, a change bar now appears in the gutter of the source editor.

  3. To show changes committed by others, click “Include upstream changes.”

View changes

Discard changes

  1. Click the change bar next to the edits you want to discard.

  2. In the dialog that appears, click Discard Change.

Find out who made conflicting changes

If you include upstream changes when you enable the change bar, the change bar will turn red if your local changes conflict with another person’s upstream changes.

  1. Hover the pointer over the red change bar.

    The range of characters that are in conflict are highlighted.

  2. Click the red change bar, then choose an action from the dialog that appears.

    The action dialog shows a summary of the other person’s commit.

  3. If you choose Discard Change, choose Source Control > Pull to pull the other person’s changes.

Open a commit in the comparison editor

  1. Click the change bar next to the edits you want to view.

  2. Choose Show Commit from the Action menu.

    The comparison editor shows the commit in the editor area.

See alsoSource control workflowCompare revisions of a file