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.
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 iflocate
isTRUE
. 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
andconfig
is not given, then orderly looks in the working directory and up through its parents until it finds an.outpack
directory
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.