How Many Commits
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
- 1 to 9 commits
- Another branch may hold commits of its own: they do not count
Write it in your browser, against the clock. The model script, with a note on each command it uses, comes after.
More Git problems
- Stage One FileBeginner
- Start a RepositoryBeginner
- The Last MessageBeginner
- Which BranchBeginner
- Delete the BranchEasy
- Fix the MessageEasy
- History of a FileEasy
- Leave It OutEasy