I am new to Git and Github. I am using terminal to use git commands. So, I create a repository on Github. I clone it on my local machine. Then, if I create a branch using git command, I can see that I am switching branch. I am able to edit the code in that branch and I am able to merge the branch to master branch as well.
When I check on Github, I don't see any history of the branches that I have made and all the changes that I make in other branches and merge them to master, they still are portrayed as a single change made on the master branch on Github when I push the code.
I would like to know how my changes in branch and merging can be reflected in Github and some relevant resource about this will be helpful.
You can check the commit as graph in github by below steps:
Insights page -> Network tab.
All of your branches of the github repo will show as graph, and you can find the relation and actions between branches by the graph.
For fast-forward merge:
If your commit history looks as below:
...---A---B---C master
\
D---E somebranch
Since there have been no new changes on master
branch, when you merge somebranch
into master
(git merge somebranch
), master
branch will point to the commit E
same as somebranch
point:
...---A---B---C---D---E master, somebranch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With