1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/repository.R
\name{init}
\alias{init}
\title{Init a repository}
\usage{
init(path = ".", bare = FALSE, branch = NULL)
}
\arguments{
\item{path}{A path to where to init a git repository}
\item{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.}
\item{branch}{Use the specified name for the initial branch in the
newly created repository. If \code{branch=NULL}, fall back to
the default name.}
}
\value{
A \code{git_repository} object
}
\description{
Init a repository
}
\examples{
\dontrun{
## 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)
}
}
\seealso{
\link{repository}
}
|