Can you get the number of lines of code from a GitHub repository?

前端 未结 15 1164
庸人自扰
庸人自扰 2020-12-04 04:26

In a GitHub repository you can see “language statistics”, which displays the percentage of the project that’s written in a language. It doesn’t, however, display ho

15条回答
  •  無奈伤痛
    2020-12-04 05:07

    Hey all this is ridiculously easy...

    1. Create a new branch from your first commit
    2. When you want to find out your stats, create a new PR from main
    3. The PR will show you the number of changed lines - as you're doing a PR from the first commit all your code will be counted as new lines

    And the added benefit is that if you don't approve the PR and just leave it in place, the stats (No of commits, files changed and total lines of code) will simply keep up-to-date as you merge changes into main. :) Enjoy.

提交回复
热议问题