.gitignore is used to prevents specified files from being tracked and included in version control. That means this is used by git to ignore which files and directories.
.Rbuildignore: is used by the R CMD build process to exclude files from the package tarball that is created when building the package.