init {git2r} | R Documentation

## Init a repository

### Description

Init a repository

### Usage

    init(path = ".", bare = FALSE)

### Arguments

`path` | A path to where to init a git repository
`bare` | If TRUE, a Git repository without a working directory is created at the pointed path. If FALSE, provided path will be considered as the working directory into which the .git directory will be created.

### Value

A `git_repository` object

### See Also

repository

### Examples

    ## Not run:
    ## Initialize a repository
    path <- tempfile(pattern="git2r-")
    dir.create(path)
    repo <- init(path)
    is_bare(repo)

    ## Initialize a bare repository
    path_bare <- tempfile(pattern="git2r-")
    dir.create(path_bare)
    repo_bare <- init(path_bare, bare = TRUE)
    is_bare(repo_bare)

    ## End(Not run)

[Package git2r version 0.23.0 Index]