Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change github diff to be side by side comparison?

Tags:

git

github

For github web browsing, it is not shown as side by side as lots of diff tool does. Can I change the diff mode to side by side? I mean on the github web.

like image 239
Adam Lee Avatar asked Feb 24 '13 05:02

Adam Lee


People also ask

How do I make changes side by side in GitHub?

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.

How do I view side by side GitHub?

Just load a commit page and click the "Show Side-By-Side Diffs" button. Things that work: - Switch between side-by-side and unified diffs - Previous comments are shown - New comments can be added to any line, but they look funky until you reload.

How do I compare the differences between two branches in GitHub?

On the Github, go to the Source view of your project. You will see a link named 'Branch List'. Once the page opens you can see a list of all the remote branches. Hit on the Compare button in front of any of the available branches to see the difference between two branches.

What is split and unified in GitHub?

The unified view shows updated and existing content together in a linear view. The split view shows old content on one side and new content on the other side. The rich diff view shows a preview of how the changes will look once the pull request is merged.


2 Answers

Yes, it is possible since Sept. 3rd 2014: see "Introducing split diffs":

https://cloud.githubusercontent.com/assets/98681/4139311/699ef6da-3399-11e4-8d8e-cf0a9e902867.gif

Diffs now come in two flavors, unified and split.
Switch between them on pull request, commit, and compare pages using the toggle in the top right of the page. The mode you last used will become your preferred default.


Note: since Sept. 4th 2014, it also support word diff highlights.
See "Does Github have a view that shows diffs between file versions?".


Since 2014, and the introduction of dark theme(!) in 2020, the UI is now:

  • from Unified:

unified

  • To split diff:

split diff

using: enter image description here

Note: adding "&diff=split" at the end of the URL will give you the same result: a split diff.

like image 72
VonC Avatar answered Sep 30 '22 15:09

VonC


You can with Octosplit Chrome extension. But you don't get the full length.

like image 28
huyz Avatar answered Sep 30 '22 15:09

huyz