How to compare two branches in Git

0 votes

Hi Guys,

I have created two branches in Git. I have lots of commits to these branches. I want to see the difference between these two branches. How can I do that?

Sep 4, 2020 in DevOps & Agile by akhtar
• 38,240 points
1,044 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use the git diff command to find the difference between branches as shown below.

$ git diff branch_1..branch_2

That will produce the diff between the tips of the two branches. If you prefer to find the diff from their common ancestor to test, you can use three dots instead of two.

$ git diff branch_1...branch_2
answered Sep 4, 2020 by MD
• 95,380 points

Related Questions In DevOps & Agile

0 votes
1 answer

How to simplify or automate task group creation in TFS?

You can easily import or export task ...READ MORE

answered Apr 25, 2018 in DevOps & Agile by ajs3033
• 7,300 points
955 views
0 votes
1 answer

How to disable auto-restart task in TeamCity

There is a parameter which can be ...READ MORE

answered Apr 29, 2018 in DevOps & Agile by DareDev
• 6,890 points
733 views
0 votes
1 answer

Any way to mark commits in git?

You can try and use git tags. Also ...READ MORE

answered May 3, 2018 in DevOps & Agile by DareDev
• 6,890 points
248 views
0 votes
1 answer

How to a run deployed app in Docker for Windows?

To deploy an ASP.NET web application to ...READ MORE

answered Aug 30, 2018 in DevOps & Agile by Tyrion anex
• 8,690 points
492 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
2,084 views
+2 votes
1 answer
0 votes
1 answer

How to get the file count in amazon bucket linux cli

Hi@Shahzeb, You can do this task using the ...READ MORE

answered Apr 27, 2020 in DevOps & Agile by MD
• 95,380 points
2,466 views
0 votes
1 answer

what is api token in jenkins and how to use for github webhook

Hi@Anil, GitHub webhook is used to trigger jenkins ...READ MORE

answered May 27, 2020 in DevOps & Agile by MD
• 95,380 points
1,173 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP