Discovery Of The Day- Git Branches in Xcode

I was already that when you commit code in Xcode (alt-⌘-c), you get a side-by-side view of the changes that you’ve made.

You can also go to the Source Control menu and look at a number of things, but it lacked an intuitive way to navigate branches.

But, wow, come to find out, that hidden in plain sight all along, was a button that turns the assistant editor into a viewer to look at the diff of the current file for any commit in any branch in your current repo. NOTE: so it’s not a great way to compare the difference between entire commits, but it is great for single files.

git-button-in-xcode

when you tap that you get the side-by-side editors (unless your a monster and you have them arranged top-bottom)

Then if you tap down at the bottom left corner of either view, you can choose commits and branches.

git-branches-xcode

As usual with such discoveries, I am torn between “WOW!!!” and “Jeeezzz, how did I not know about this?!?!”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s