Show / Hide Table of Contents

Class Repository

The representation of a Git repository, including its objects, references and the methods that operate on it.

Inheritance
System.Object
NativeDisposable
Repository
Inherited Members
NativeDisposable.Dispose()
Namespace: Dogged
Assembly: Dogged.dll
Syntax
public class Repository : NativeDisposable

Properties

| Improve this Doc View Source

Head

Retrieve and resolve the reference pointed to by HEAD. The repository HEAD will be peeled to a direct reference.

Declaration
public DirectReference Head { get; }
Property Value
Type Description
DirectReference
| Improve this Doc View Source

HeadCommit

Get the commit pointed to by HEAD.

Declaration
public Commit HeadCommit { get; }
Property Value
Type Description
Commit
| Improve this Doc View Source

Index

Describes the repository's index.

Declaration
public Index Index { get; }
Property Value
Type Description
Index
| Improve this Doc View Source

IsBare

Indicates whether the specified repository is bare.

Declaration
public bool IsBare { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsHeadDetached

Indicates whether the HEAD is detached, meaning it points directly at an object id instead of a branch.

Declaration
public bool IsHeadDetached { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ObjectDatabase

Declaration
public ObjectDatabase ObjectDatabase { get; set; }
Property Value
Type Description
ObjectDatabase
| Improve this Doc View Source

Objects

An accessor for Git objects.

Declaration
public ObjectCollection Objects { get; }
Property Value
Type Description
ObjectCollection
| Improve this Doc View Source

Path

Declaration
public string Path { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

References

An accessor for references.

Declaration
public ReferenceCollection References { get; }
Property Value
Type Description
ReferenceCollection
| Improve this Doc View Source

Workdir

Declaration
public string Workdir { get; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

Clone(String, String)

Clone a remote repository.

Declaration
public static Repository Clone(string remotePath, string localPath)
Parameters
Type Name Description
System.String remotePath

The remote repository to clone

System.String localPath

The local path to clone to

Returns
Type Description
Repository

The newly cloned repository

| Improve this Doc View Source

CreateCustomRepository()

Create a custom repository that is not bound to an on-disk repository or working directory. To use it, you can can configure custom backends.

Declaration
public static Repository CreateCustomRepository()
Returns
Type Description
Repository

The newly created repository

| Improve this Doc View Source

Discover(String, Boolean)

Discover the git repository that the given path is beneath. Walks up parent paths until the repository working directory is found and returns the Repository.

Declaration
public static string Discover(string path, bool acrossFilesystems = false)
Parameters
Type Name Description
System.String path

The path to start discovery at.

System.Boolean acrossFilesystems

Whether to traverse filesystem boundaries (false by default)

Returns
Type Description
System.String

The newly repository, or null if none was discovered

| Improve this Doc View Source

Init(String, Boolean)

Creates a new Git repository in the given folder.

Declaration
public static Repository Init(string path, bool bare = false)
Parameters
Type Name Description
System.String path

The path to the repository

System.Boolean bare

If true, a Git repository without a working directory is created at the given path. If false, the provided path will be considered as the working directory into which the .git directory will be created.

Returns
Type Description
Repository

The newly initialized repository

| Improve this Doc View Source

Open(String)

Opens the Git repository at the given path. This can be either a path to the repository's working tree, or to the actual repository folder (the ".git" folder beneath a working directory or a bare repository).

Declaration
public static Repository Open(string path)
Parameters
Type Name Description
System.String path

The path to the repository or a repository's working tree.

Returns
Type Description
Repository

The repository

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX