# NOT RUN {
# Compare the last committed change with current working version
git_diff() # this is exactly equivalent to next line
git_diff('.', n=1, NULL)
git_diff('README.md')
git_diff('README.md', n=2)
git_diff('README.md', n=2, n=1)
# Compare the directory structure now with a previous date
git_diff('.', before='2021-10-25')
# Latest between branches
git_diff('myfile', branch='master', branch='test')
# Compare file contents of a commit hash with most recent by author
git_diff('R/git_helper.R', hash='abc123', author='somebody')
# Can also get a git_commit object directly to pass over if multiple filtering
git_diff('R/', git_get(author='somebody', before='2021-10-25'), NULL)
# Or even taking a commit number from the branch history (but will be verbose)
git_diff('README.md', git_history()[[1]], n=1 )
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab