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:
21
README.md
21
README.md
@@ -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.
|
||||
|
Reference in New Issue
Block a user