Is it possible to show diff between 2 branches using GitHub web interface? Is it possible to show diff between 2 commits using GitHub web interface?
            Asked
            
        
        
            Active
            
        
            Viewed 1,345 times
        
    2 Answers
5
            To show the difference between two branches, do the first step of starting a pull request. You can either use the UI interface on GitHub.com, or adapt this URL:
https://github.com/<account_name>/<repo_name>/compare/<base-branch>...<compare-branch>
To see differences between two commits you can adapt this URL (I do not know how to "click" myself to this):
https://github.com/<account_name>/<repo_name>/compare/<commit-base-short-sha>..<commit-compare-short-sha>
See here for a description of the difference between the .. and ... in the two URLs above.
        TheIceBear
        
- 2,912
 - 9
 - 23
 
2
            
            
        
        Philippe
        
- 28,207
 - 6
 - 54
 - 78
 
- 
                    What about diff between 2 commits? (I mean not between 2 commits, but more like between states at these 2 commits) As I understand I can just create branches from these 2 commits and use your method to compare branches, but is there more direct way? – mrgloom Sep 17 '20 at 14:46
 - 
                    See my answer for a more direct way to see commit diffs – TheIceBear Sep 17 '20 at 15:53
 - 
                    I have checked this method to compare 2 branches and it gives me weird results, like highlighting diff of removed lines that are not presented in 1st and 2nd branches final state. – mrgloom Sep 17 '20 at 15:59
 - 
                    Actually (2 dots) `https://github.com/
/ – mrgloom Sep 17 '20 at 16:05/compare/ .. ` is what I was looking for, and (3 dots) `https://github.com/ / /compare/ ... ` seems the same as if we use `Compare` from web interface and it produce 'weird' diff.  - 
                    Yes, when comparing branches GitHub defaults to 3-dots. What is weird about it? – TheIceBear Sep 17 '20 at 16:32
 
