repo <- git_init(tempfile("githug-"))
owd <- setwd(repo)
write("Are these girls real smart or real real lucky?", "max.txt")
git_commit("max.txt", message = "lines from max")
write("Did I hear somebody say \"Peaches\"?", "jimmy.txt")
git_commit("jimmy.txt", message = "lines from some guy")
git_history() ## note the SHA of the most recent commit
## fix the previous commit message
git_amend(message = "lines from jimmy", ask = FALSE)
git_history() ## note the SHA of most recent commit has changed
setwd(owd)
Run the code above in your browser using DataLab