Git Commit Utilities
Usage
get_commit_msgs(sha = NULL, n = 1L)
scrape_commits(n)
git_unstage(file = NULL)
git_reset_soft(n = 1L)
git_uncommit()
git_reset_hard()
git_diffcommits(top = 1L, n = 2L)
Arguments
- sha
character(n)
. The commit secure hash algorithm (SHA-1). IfNULL
, typically points to the most recent commit on the current branch.- n
integer(1)
. How far back to go from currentHEAD
. Same as the command linegit log -n
parameter. Forgit stash
commands, zero-index into the stash list.- file
character(1)
. The path to a file.- top
integer(1)
. The commit to consider the "top" of the commit stack. Defaults toHEAD~0
ortop = 1
.
Value
NULL
... invisibly.
A list containing commit message entries.
The sha
and author
of each commit is added as attributes.
Functions
get_commit_msgs()
: gets the commit messages corresponding to the commitsha
.sha
can becharacter(n)
, but must be valid SHAs corresponding to commits in the repository.scrape_commits()
: scrapesn
commit messages for useful change log commits to be used to create aNEWS.md
.git_unstage()
: un-stages a file from the index to the working directory. Default un-stages all files.git_reset_soft()
: un-commits the most recently committed file(s) and add them to the staging area.git_uncommit()
: un-commits the most recently committed file(s) and add them to the staging area. Wrapper aroundgit_reset_soft()
git_reset_hard()
:git reset --hard origin/<branch>
.git_diffcommits()
: gets the diff of the corresponding 2 commits. Order matters!