Skip to contents

Update a gitignore, which is useful to prevent accidentally committing files to source control that are generated. This includes artefacts, shared resources and dependencies (within a report directory) or at the global level all the contents of the .outpack directory, the draft folder and the archive directory.

Usage

orderly_gitignore_update(name, root = NULL, locate = TRUE)

Arguments

name

The name of the gitignore file to update, or the string "(root)"

root

The path to the root directory, or NULL (the default) to search for one from the current working directory if locate is TRUE. This function does require that the directory is configured for orderly, and not just outpack (see orderly_init for details).

locate

Logical, indicating if the configuration should be searched for. If TRUE and config is not given, then orderly looks in the working directory and up through its parents until it finds an .outpack directory

Value

Nothing, called for its side effects

Details

If this function fails with a message Can't edit '.gitignore', markers are corrupted, then look for the special markers within the .gitignore file. It should look like

# ---VVV--- added by orderly ---VVV----------------
# Don't manually edit content between these markers
... patterns
# ---^^^--- added by orderly ---^^^----------------

We can't edit the file if:

  • any of these lines appears more than once in the file

  • there is anything between the first two lines

  • they are not in this order

If you get the error message, search and remove these lines and rerun.