Is there a way to count the total number of change that appears in a pull request ? I wanted to build a tool that should restrict the users to commit, if the PR Lines of Change is more than a certian threshold.
I tried doing git diff origin/master..<featureBranch>
but it's giving some incorrect lines of change. Any help is appreciated.
For counting changed lines of code in pull request you should use
git log --shortstat sha_of_commit
or
git log --stat sha_of_commit (more verbose output)
or if you have some diff, not commit, then you should swap diff with log:
git diff --stat / --shortstat
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With