1
0
mirror of https://github.com/tiimgreen/github-cheat-sheet.git synced 2025-08-12 10:53:58 +02:00

Comparing Branches

This commit is contained in:
Tim Green
2014-04-12 21:18:46 +01:00
parent 835c2e986a
commit 117ae834f9

View File

@@ -109,6 +109,27 @@ To view all commits on a repo by author add `?author=username` to the URL.
https://github.com/rails/rails/commits/master?author=dhh
```
## Comparing Branches
In GitHub to compare branches, the URL will look something like this:
```
https://github.com/user/repo/compare/{range}
```
Where `{range} = master...4-1-stable`
e.g.:
```
https://github.com/rails/rails/compare/master...4-1-stable
```
`{range}` is smart and can be changed to things like:
```
https://github.com/rails/rails/compare/master@{1.day.ago}...master
```
which allows you to see the difference on the master branch up to one day ago.
## Line Highlighting in Repos
Adding `#L52` to the end of a code file URL will highlight that line number.