Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to check changes made from an old git branch that has been merged

help needed here.. does anyone know how to check the changes of an old git branch that has been merged?

Asking this because i want to learn from previously merged branch by others.

I switched to the old branch and did a git diff HEAD^ HEAD
and there was no result.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

As explained by you we assume we have a feature branch A and a main branch B.

In the actions provided by you, I merged A into B.
Post the above merge as you pointed out ( git diff HEAD^ HEAD) you are seeing the result as "no result" which is the ideal behavior.

Reson being all the changes that were there in branch A is now part of branch B hence the message.

to confirm this you can make some changes in Branch A -> commit the changes and now try comparing both the branches. this will result in displaying the diff produced by the commit.

If in case you want to learn the changes which were there in the previous branch you need to refer to the command called git log, which solves the exact issue you are facing.

More about git log:
https://git-scm.com/docs/git-log

This will answer your queries. Hope this helps, Thanks.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading