EVOLUTION-MANAGER
Edit File: git_repo.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Create or discover a local Git repository</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for git_repo {gert}"><tr><td>git_repo {gert}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Create or discover a local Git repository</h2> <h3>Description</h3> <p>Use <code>git_init()</code> to create a new repository or <code>git_find()</code> to discover an existing local repository. <code>git_info()</code> shows basic information about a repository, such as the SHA and branch of the current HEAD. </p> <h3>Usage</h3> <pre> git_init(path = ".", bare = FALSE) git_find(path = ".") git_info(repo = ".") </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>path</code></td> <td> <p>the location of the git repository, see details.</p> </td></tr> <tr valign="top"><td><code>bare</code></td> <td> <p>if true, a Git repository without a working directory is created</p> </td></tr> <tr valign="top"><td><code>repo</code></td> <td> <p>The path to the git repository. If the directory is not a repository, parent directories are considered (see <a href="git_repo.html">git_find</a>). To disable this search, provide the filepath protected with <code><a href="../../base/html/AsIs.html">I()</a></code>. When using this parameter, always explicitly call by name (i.e. <code style="white-space: pre;">repo = </code>) because future versions of gert may have additional parameters.</p> </td></tr> </table> <h3>Details</h3> <p>For <code>git_init()</code> the <code>path</code> parameter sets the directory of the git repository to create. If this directory already exists, it must be empty. If it does not exist, it is created, along with any intermediate directories that don't yet exist. For <code>git_find()</code> the <code>path</code> arguments specifies the directory at which to start the search for a git repository. If it is not a git repository itself, then its parent directory is consulted, then the parent's parent, and so on. </p> <h3>Value</h3> <p>The path to the Git repository. </p> <h3>See Also</h3> <p>Other git: <code><a href="git_archive.html">git_archive</a></code>, <code><a href="git_branch.html">git_branch</a>()</code>, <code><a href="git_commit.html">git_commit</a>()</code>, <code><a href="git_config.html">git_config</a>()</code>, <code><a href="git_diff.html">git_diff</a>()</code>, <code><a href="git_fetch.html">git_fetch</a>()</code>, <code><a href="git_merge.html">git_merge</a>()</code>, <code><a href="git_rebase.html">git_rebase</a>()</code>, <code><a href="git_remote.html">git_remote</a></code>, <code><a href="git_signature.html">git_signature</a>()</code>, <code><a href="git_stash.html">git_stash</a></code>, <code><a href="git_tag.html">git_tag</a></code> </p> <h3>Examples</h3> <pre> # directory does not yet exist r <- tempfile(pattern = "gert") git_init(r) git_find(r) # create a child directory, then a grandchild, then search r_grandchild_dir <- file.path(r, "aaa", "bbb") dir.create(r_grandchild_dir, recursive = TRUE) git_find(r_grandchild_dir) # cleanup unlink(r, recursive = TRUE) # directory exists but is empty r <- tempfile(pattern = "gert") dir.create(r) git_init(r) git_find(r) # cleanup unlink(r, recursive = TRUE) </pre> <hr /><div style="text-align: center;">[Package <em>gert</em> version 1.9.1 <a href="00Index.html">Index</a>]</div> </body></html>