Tag: diffs

How to know what the capitalized letter means in [Y/n] – 108

I promised myself I’d be honest, brutally honest, about all the things I’ve had to learn. And one of them is about the capitalized letter when you’re presented with such a question in a command line interface.

I’ll admit I was typing in ‘Y’ as a response. Perhaps it wants me to be really sure. Kinda like when you want to get hot water out of a water cooler, you have to press 2 buttons or hold one button down, etc.

The capitalized letter is the default if you were to simply press enter.

For example, if you want to open VS as your external diff tool, as you saw in yesterday’s tip

$ git difftool branch-name file-name

Launch 'vsdiffmerge' [Y/n]?

You can simply press enter, and the vsdiffmerge command will be run!

How to view and diff a 3D model hosted on GitHub – 055

GitHub has a built-in 3D file viewer that allows you to get a 360 degree view of your 3D models. This 3D file viewer also gives you an interactive diff experience to compare changes between commits!

I created a quick cube using Microsoft’s 3D Builder. I added it to my repo and pushed it up to GitHub.

There are 3 options for viewing the 3D model.

Solid view

Solid green cube

Wireframe view

wireframe of a green cube

Surface Angle

Each surface drawn with a different color

And the grand finale, how to view a diff of a 3D Model.

Using the 3D Builder software, I added a cone to the top of the cube. I pushed these changes up to GitHub.

cube with cone added at top

If you look at the diff of the commit (click the commit ID circled in red above), you’ll see the diff viewer. By default it shows you what’s changed. Since I added a cone, the cone is shown in green (for additive).

green cone on top of wireframe cube

At the bottom of the image, you’ll find the Revision Slider. Click this link for an interactive 3D diff experience!

In the image below, you’ll see how the cone is added.

interactive 3D viewer showing changes as the slider changes

How to view diffs of images in a GitHub repo – 054

GitHub offers 3 ways for you to diff your images. For example, this commit diff shows how I checked in an image and then changed the image completely in the next commit.

commit diff showing how the octocat as Clark Kent has changed into the octocat as Superman w a 'G' logo

At the bottom of the image, you’ll see the options for 2-up, Swipe, and Onion Skin.

2-up

The default view is the 2-up, which shows the images before and after side-by-side.

Swipe

Swipe allows you to do more of a pixel-by-pixel comparison by allowing you to slide a splitter back and forth over the image.

half Clark Kent image and half Superman-octo image

Onion Skin

Onion skin allows you to pick up on subtle changes you might have otherwise missed. Although there’s nothing subtle with the image I picked Smile

animated gif showing a slow change from octo-Kent to octo-Superman

Today’s tip of the day images are brought to you by https://octodex.github.com/. And thanks to the Help Documentation for clarifying when to use Onion Skin versus Swipe!

How to view the diff of a markdown (.md) file as its rendered content – 031

When you’re viewing changes to a markdown file, you have the option to compare the rendered versions in the diff view.

Let’s say you wanted to view the diff of my latest commit to my README.md in my random-example repo. By default you are looking at the raw markdown contents, i.e. the “source diff.”

viewing latest diff of readme as source

But suppose you wanted to view the actual rendered markdown file as a diff. Click on the Display the Rich Diff button located in the upper right.

Display the rich diff button in upper right

Now you’ll see the diff of the README.md file as a rendered file.

display the diff of README.md as a rendered file

How to view a diff for a commit as files side by side on GitHub – 028

Personally, I’m not a fan of the inline diffs that make you do homework to figure out what’s being added and what’s being removed.

For example, if you go to the Code – Commits page and click on the commit id for a given commit, as shown in the illustration below,

Code - Commits page clicking on a commit id

You’re taken to a page that shows the diffs as inline or unified for the file.

diff of readme.md that's shown unified

Fortunately, there’s a split button in the upper right hand corner that says Unified | Split.

Clicking on Split portion of the button will show the before and after changes side by side, which is just my personal preference.

diff showing changes before and after side by side

How to view the diffs for a specific commit for a specific branch in GitHub – 027

Suppose you want to see what changed between two commits on a particular branch. First, you can go to the Code tab and change the desired branch (see previous tips on how to do this).

Next click Commits link,

Commits link being clicked on Code page

and navigating to the desired commit, you can click on the commit id (as highlighted in the image below).

Fixed compile error commit id button highlighted

Now you can see all the changes for that particular commit.

Showing 1 changed file with 3 additions and 3 deletions