git_ignore: Modify .gitignore file

Description Usage Arguments Value Examples

View source: R/github.R

Description

Arguments passed through ... are added to the .gitignore file. Elements already present in the file are modified. When ignore = TRUE, the arguments are added to the .gitignore file, which will cause 'Git' to not track them.

When ignore = FALSE, the arguments are prepended with !, This works as a "double negation", and will cause 'Git' to track the files.

Usage

1
git_ignore(..., ignore = TRUE, repo = ".")

Arguments

...

Any number of character arguments, representing files to be added to the .gitignore file.

ignore

Logical. Whether or not 'Git' should ignore these files.

repo

a path to an existing repository, or a git_repository object as returned by git_open, git_init or git_clone.

Value

No return value. This function is called for its side effects.

Examples

1
2
3
4
dir.create(".git")
git_ignore("ignorethis.file")
unlink(".git", recursive = TRUE)
file.remove(".gitignore")

worcs documentation built on Feb. 2, 2021, 5:13 p.m.