Hi all Git and Github experts!
I was expecting the Github Compare view of 2 branches to simply show - by default - the differences between the current state of those said 2 branches, as the Git Diff with previous version: command does on a local git install, but not so... Here is my scenario.
1.- create test01 repository on github and clone to local machine
ON LOCAL MACHINE
2.- master: add test.txt
3.- test.txt: aaa ccc
4.- commit (message: step01) and push to master
5.- create branch01 branch Base On HEAD(master) and switch to it
6.- branch01 modify contents of test.txt to aaa bbb ccc
7.- commit (message: step02) and push to branch01
8.- switch to master and modify contents of test.txt to aaa bbb ccc
9.- commit (message: step03) and push to master
10.- switch to branch01
11.- Git Diff with previous version: master -> the diff window is empty, since all files in both branches are identical. This is what I expect to see.
GO TO GITHUB
12.- Now go to my github https://github.com/rezeau/test01 and select branch:master and click the test.txt file to view it. It shows: aaa bbb ccc
13.- Now Select branch: branch01 and click the test.txt file to view it. It also shows: aaa bbb ccc.
14.- Now I want to compare the master and the branch01 branches, same as I did on my local machine, using the Git Diff command. So, whilst still on the branch01 branch, click the Branches tab (2).
15. Now click the Compare button at bottom right. I am expecting the Compare View to show nothing, since all files in both branches are identical. But it shows in file test.txt a previous state (- aaa ccc) and the current state (+aaa bbb ccc).
Note: the "comments" zone shows step03.
16.- If I click the Switch base of comparison, I see the same. Except that the "comments" zone now shows step02.
---OK, continuing experiment ON LOCAL MACHINE---
17.- Check that we are on branch01. Edit test.txt file to read: aaa bbb ccc ddd
18.- Commmit to github as step04 and push to github, branch01
19.- Git Diff with previous version: master -> the diff window shows, as expected
on the left (master) aaa bbb ccc
on the right (branch01) aaa bbb ccc ddd
19.- GO TO GITHUB
20.- Try to compare again the master and branch01 branches. In the "Showing 1 changed file with 1 addition and 1 deletion." zone I see:
+aaa bbb ccc ddd
Where I would expect to see:
-aaa bbb ccc
+aaa bbb ccc ddd
Question: When comparing 2 branches, how can I get displayed on my github (screenshot #1) the very same results as I get on my local machine (screenshot #2)?