Xcode 10: See Changed Code in Editor

September 27th, 2018

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

If your Xcode project is under version control, Xcode’s editor highlights the changes you make to the code. When you add or change code, Xcode places a blue bar on the left edge of the editor.

Xcode10VersionControlChangesInEditorHighlighted

Clicking the blue bar opens a popover to discard the change. For some reason you can’t commit changes from the editor. You can only discard changes.

If you remove code, there may be a blue dot instead of a blue bar in the editor. Click the dot to discard the change and restore the code you removed.

Other Bar Colors

The blue bar on the left side of the editor window is the most common color you’ll see. But Xcode also has the following color bars for source control changes:

  • A gray bar indicates changes you committed locally but did not push to a remote repository.
  • A blue outline indicates upstream changes, changes someone else working on the project made.
  • A red bar indicates the changes you made conflict with upsream changes.

Troubleshooting

If you do not see colored bars on the left side of the editor, you may need to turn on showing source control changes from Xcode’s Source Control preferences.

Xcode10SourceControlPreferences

Make sure the Show Source Control changes checkbox is selected. Select the Include upstream changes checkbox to see upstream changes in the editor.

Tags:


Leave a Reply

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