Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to see changed lines of code between 2 branches for specific file type?

Tags:

git

I want to create a metric that shows me "changed lines of code" per "Bug" between two Versions (in my case branches in git).

Because our application has a lot of .swf files, I don't need to count those swf's files and I just want to count the java, xml and so on.

Is there some kind of tool who does that? or a git command like git diff --stat for a specific file type?

like image 918
Shahar Hamuzim Rajuan Avatar asked Apr 24 '14 11:04

Shahar Hamuzim Rajuan


People also ask

How do I see changes between two branches?

Using git-diff you can compare two branches by viewing a diff between them, or you can use git-log to view a list of commits that comprise the difference between them. Compare two branches with git diff branch1.. branch2 . Check the Full Official Documentation for git-diff and git-log for more options.

How do I compare files between two branches in github?

The second command that you can use to compare branch differences is “log.” git log will show you all of the commit differences between the branches you specify, and, aside from the term diff being replaced with log, the syntax is exactly the same as the previous command.

How do I see differences between files in git?

You can run the git diff HEAD command to compare the both staged and unstaged changes with your last commit. You can also run the git diff <branch_name1> <branch_name2> command to compare the changes from the first branch with changes from the second branch. Order does matter when you're comparing branches.

How do I see differences between two branches in git Visual Studio?

To compare your currently checked out branch with other branches using Visual Studio, you can utilize the branch picker hosted in the status bar and the Git changes tool window to choose any local or remote branch to compare with. Right click the branch you are targeting and select Compare with Current Branch.


1 Answers

Does

 git diff --stat branch1..branch2 -- '*.java' '*.xml'

do the job for you?

For me it does, but with *.c and *.h.

like image 189
Patrick B. Avatar answered Sep 21 '22 12:09

Patrick B.