git_repository_init_flag_t

Option flags for git_repository_init_ext.

These flags configure extra behaviors to git_repository_init_ext. In every case, the default behavior is the zero value (i.e. flag is not set). Just OR the flag values together for the flags parameter when initializing a new repo. Details of individual values are:

* BARE - Create a bare repository with no working directory. * NO_REINIT - Return an git_error_code.GIT_EEXISTS error if the repo_path appears to already be an git repository. * NO_DOTGIT_DIR - Normally a "/.git/" will be appended to the repo path for non-bare repos (if it is not already there), but passing this flag prevents that behavior. * MKDIR - Make the repo_path (and workdir_path) as needed. Init is always willing to create the ".git" directory even without this flag. This flag tells init to create the trailing component of the repo and workdir paths as needed. * MKPATH - Recursively make all components of the repo and workdir paths as necessary. * EXTERNAL_TEMPLATE - libgit2 normally uses internal templates to initialize a new repo. This flags enables external templates, looking the "template_path" from the options if set, or the init.templatedir global config if not, or falling back on "/usr/share/git-core/templates" if it exists. * GIT_REPOSITORY_INIT_RELATIVE_GITLINK - If an alternate workdir is specified, use relative paths for the gitdir and core.worktree.

Values

ValueMeaning
GIT_REPOSITORY_INIT_BARE1u << 0
GIT_REPOSITORY_INIT_NO_REINIT1u << 1
GIT_REPOSITORY_INIT_NO_DOTGIT_DIR1u << 2
GIT_REPOSITORY_INIT_MKDIR1u << 3
GIT_REPOSITORY_INIT_MKPATH1u << 4
GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE1u << 5

Meta