Compare two branches in GitHub

Peter Marshall · January 21, 2021

There is a clean way to compare two branches in GitHub, but the UI does not show this anywhere.

On the URL you need to use the compare route, followed by the first branch name followed by three dots followed by the second branch name.

So for example:

If I have a reposoitory called ‘https://github.com/petermarshall/xcafe-web’ and a branch called ‘tidy-source-and-images’ and a branch called ‘workpc’

I can create the url: ‘https://github.com/petermarshall/xcafe-web/compare/tidy-source-and-images…workpc’

It is the first time I have seen anyone use three dots (…) to have any meaning in a url and I am unsure of the origin of this convention.

As a side issue I have just finished reading ‘The Midnight Library’ by Matt Haig. Which was uplifting and life asserting, but a bit predictable. The book was I suppose (maybe) aimed at depressed people, perhaps. I didnt learn anything from the book. Maybe I am too positive already.

Twitter, Facebook