Learn R Programming

gitGPT (version 0.1.3)

commit: Commit changes using an auto-generated commit message

Description

An R wrapper to automatically add, commit, and push changes to a git repository using an auto-generated commit message. The commit message is generated by an API call to the 'OpenAI' 'GPT-3.5 Turbo' model using the git diff output as input.

Usage

commit(commit_message, prepend)

Value

No return value, called for side effects.

Arguments

commit_message

A custom commit message. If not provided, a message will be generated automatically.

prepend

A string to prepend to the commit message. Defaults to an empty string. A convention may be to prepend 'GPT: ' to the beginning of the commit message so you can differentiate between those you wrote vs those GPT composed.

Examples

Run this code
if (FALSE) {
  # Simple command to git add, git commit, and git push with a commit
  # message based on git diff of the working directory
  commit()
}

Run the code above in your browser using DataLab