How To Check The Previous Commits ?
Table Of Contents:
- How To Check The Previous Commits?
- How To Count The Number Of Commits?
(1) How To Check The Previous Commits?
- To check the previous commits you have done, use the below command.
git log – raw
![](https://www.praudyog.com/wp-content/uploads/2023/03/89.png)
![](https://www.praudyog.com/wp-content/uploads/2023/03/88.png)
Note:
- Here you can see the number of commits you have done and the files that you have committed.
(2) How To Count The Number Of Commits?
- To count the commits for the branch you are on:
git rev-list – count HEAD
- To count the commits for the particular branch
git rev-list – count <branch-name>
Example
git rev-list – count HEAD
![](https://www.praudyog.com/wp-content/uploads/2023/03/90.png)
![](https://www.praudyog.com/wp-content/uploads/2023/03/91.png)
Note:
- Here you got the output as ‘2.’