Skip to contents

Get commits associated chronologically with tags


get_commits_tags(repo = ".", ref = "main", path = NULL, silent = FALSE)



a path to a repository or a git_repository object. Default is '.'


The name of a reference to list commits from e.g. a tag or a branch. The default is NULL for the current branch.


The path to a file. If not NULL, only commits modifying this file will be returned. Note that modifying commits that occurred before the file was given its present name are not returned; that is, the output of git log with --no-follow is reproduced.


Logical. Whether to hide messages.


A tibble with one line for each commit and the following columns:

  • sha: sha of the commit

  • summary: First line of the commit message

  • message: Full content of the commit message

  • author: author of the commit

  • email: email of the author

  • when: commit time

  • order: order of commit messages. 1 is the oldest.

  • name of tag associated with all commits since the last tag

  • tag.message: message of the tagged commit


repo <- fake_repo()
get_commits_tags(repo = repo)
#> 4 commits found.
#> # A tibble: 4 × 9
#>   sha            summary message author email when                order
#>   <chr>          <chr>   <chr>   <chr>  <chr> <dttm>              <int> <chr>   
#> 1 e57163b189ae8… Add NE… "Add N… Alice  alic… 2024-05-22 01:00:04     4 NA      
#> 2 3a747a44b19f9… Third … "Third… Alice  alic… 2024-05-22 01:00:04     3 v0.1    
#> 3 50cd2f7b423e6… exampl… "examp… Alice  alic… 2024-05-22 01:00:04     2 v0.1    
#> 4 08ac8c6ae4540… First … "First… Alice  alic… 2024-05-22 01:00:04     1 v0.1    
#> # ℹ 1 more variable: tag.message <chr>