Namespaces

Types in GitSharp

Type Branch

Namespace GitSharp

Parent Ref

Represents a branch in git. You can create and manipulate git branches and you can manipulate your working directory using Branch. Note, that new Branch( ...) does not create a new branch in the repository but rather constructs the object to manipulate an existing branch. To create a new branch use the static Branch.Create API.

Methods

Properties

Public instance methods

void Checkout()

Check out this branch into the working directory and have HEAD point to it.

void Delete()

Delete this branch Not yet implemented!

void Merge(Branch other)

Merge the given branch into this Branch. Not yet implemented!

void Rename(string name)

Rename the Branch. Not yet implemented!

void Reset(ResetBehavior resetBehavior)

Reset this Branch to the current Commit using the given ResetBehavior. Reset for explanation of the reset behavior.

void Reset(Commit commit, ResetBehavior resetBehavior)

Reset this Branch to the given Commit using the given ResetBehavior.

Reset behavior:

void Reset(string commitHash, ResetBehavior resetBehavior)

Reset this Branch to the named Commit using the given ResetBehavior. Reset for explanation of the reset behavior.

Public static methods

Branch Create(Repository repo, string name, Commit commit)

Create a new branch basing on the given commit
Parameters
Repository repo
string name

The name of the branch to create (i.e. "master", not "refs/heads/master")

Commit commit

The commit to base the branch on.

Return
Branch

returns the newly created Branch object

Public properties

Commit CurrentCommit get;

Returns the latest commit on this branch, or in other words, the commit this branch is pointing to.

string Fullname get;

Get the branch's full path name relative to the .git directory

bool IsBranch get;

bool IsCurrent get;

True if the branch is the current branch of the repository

bool IsRemote get; set;

True if this Ref points to a remote branch.

string Name get;

AbstractObject Target get;