Skip to contents

Initialise a resrepo, creating all the necessary files and directories.

Usage

init_resrepo(path = ".")

Arguments

path

the path of the git repository to initialise (or of a directory inside it); by default, the working directory

Value

TRUE if all the files of the template were created or kept

Details

In a repository that already has files, nothing is overwritten: the files of the template that exist already (e.g. README.md) are kept (and listed in a message), and the rules of the template's .gitignore that are missing are appended to the existing .gitignore. Only the files that init_resrepo() created or changed are committed, so that other files (data, secrets, work in progress) are left as they were; a .gitignore that had uncommitted changes is left for the user to commit. Calling init_resrepo() on a repository that is already versioned (has data/version_meta/) stops with an error, to avoid creating real data/raw and data/intermediate directories on a fresh clone before version_relink().