View source: R/add_to_gitignore.R
add_to_gitignore | R Documentation |
add_to_gitignore
adds entries to gitignore based on file extension or file size
add_to_gitignore(add.to.gitignore = FALSE, cutoff = NULL, extension = NULL, path = ".")
add.to.gitignore |
Logical to control if files are added to 'gitignore' or just printed on the console. |
cutoff |
Numeric. Defines the file size (in MB) cutoff used to find files (i.e. only files above the threshold would returned). 99 (MB) is recommended when hosting projects at github as the current file size limit is 100 MB. |
extension |
Character string to define the file extension of the files to be searched for. |
path |
Path to the project directory. Default is current directory. |
The function can be used to avoid conflicts when working with large files or just avoid adding non-binary files to remote repositories. It mostly aims to simplify spotting/excluding large files. Note that file names can be manually added to the '.gitignore' file using a text editor.
Prints the name of the files matching the searching parameters. If add.to.ignore = TRUE
the files matching the search parameters ('cutoff' and/or 'extension') would be added 'gitignore' (a file used by git to exclude files form version control, including adding them to github).
Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)
Araya-Salas, M., Arriaga, A. (2023), sketchy: research compendiums for data analysis in R. R package version 1.0.3.
compendiums
, make_compendium
{
data(compendiums)
make_compendium(name = "my_compendium", path = tempdir(),
format = "basic", force = TRUE)
# save a file
write.csv(iris, file.path(tempdir(), "my_compendium", "iris.csv"))
# add the file to gitignore
add_to_gitignore(add.to.gitignore = TRUE,
path = file.path(tempdir(), "my_compendium"), extension = "csv")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.