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,170 points
162 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,040 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,280 points
613 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
307 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
94 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 29, 2018 in DevOps & Agile by Tyrion anex
• 8,650 points
257 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
961 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,040 points
569 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,040 points
496 views