Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (27.5k points)
recategorized by

Let's say I created a new branch my_experiment from master and made several commits to my_experiment. If I do a git log when on my_experiment, I see the commits made to this branch, but also the commits made to master before the my_experiments branch was created.

I would find it very useful to see the history of all commits to the my_experiments branch until it hits the creation of that branch - effectively a true history of just that branch. Otherwise, it's not clear to me when looking through the log whether the commits were on the my_experiments branch or not.

Is there a way to do this with Git?

1 Answer

0 votes
by (19.4k points)

If you have checked out my_experiment branch. The following command will compare where the master is at.

Here's what you can do: 

$ git log master..

Browse Categories

...