FunctionRacerProblemsRace

How Many Commits

BeginnerGita shell script

Print the number of commits in the history of the branch you are on.

Example 1

starts as
* ed4d02e (HEAD -> main) three
* cd7750c two
* 0cbd544 one
nothing to commit
prints
3

Constraints

Race itor take your time

Write it in your browser, against the clock. The model script, with a note on each command it uses, comes after.

More Git problems