C# Class GitSharp.Branch

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.
Inheritance: Ref
Exibir arquivo Open project: stschake/GitSharp Class Usage Examples

Public Methods

Method Description
Branch ( Ref @ref ) : System
Branch ( Repository repo, string name ) : System
Checkout ( ) : void

Switch to this branch and check it out into the working directory.

Create ( Repository repo, string name ) : Branch

Create a new branch from HEAD.

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

Create a new branch from the given commit

Delete ( ) : void

Delete this branch

Merge ( Branch other ) : void
Rename ( string name ) : void
Reset ( ) : void
Reset ( Commit commit ) : void
Reset ( Commit commit, ResetBehavior resetBehavior ) : void
Reset ( ResetBehavior resetBehavior ) : void
Reset ( string commitHash ) : void
Reset ( string commitHash, ResetBehavior resetBehavior ) : void
SwitchTo ( Branch branch ) : void

Switch to the given branch

ToString ( ) : string

Private Methods

Method Description
Branch ( Repository repo, GitSharp.Core.Ref @ref ) : System
GetSafeCurrentCommit ( ) : Commit
ResetHard ( Commit commit ) : void
ResetSoft ( Commit commit ) : void
ResolveCommit ( string commitHash ) : Commit

Method Details

Branch() public method

public Branch ( Ref @ref ) : System
@ref Ref
return System

Branch() public method

public Branch ( Repository repo, string name ) : System
repo Repository
name string
return System

Checkout() public method

Switch to this branch and check it out into the working directory.
public Checkout ( ) : void
return void

Create() public static method

Create a new branch from HEAD.
public static Create ( Repository repo, string name ) : Branch
repo Repository
name string The name of the branch to create (i.e. "master", not "refs/heads/master")
return Branch

Create() public static method

Create a new branch from the given commit
public static Create ( Repository repo, string name, Commit commit ) : Branch
repo Repository
name string 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

Delete() public method

Delete this branch
public Delete ( ) : void
return void

Merge() public method

public Merge ( Branch other ) : void
other Branch
return void

Rename() public method

public Rename ( string name ) : void
name string
return void

Reset() public method

public Reset ( ) : void
return void

Reset() public method

public Reset ( Commit commit ) : void
commit Commit
return void

Reset() public method

public Reset ( Commit commit, ResetBehavior resetBehavior ) : void
commit Commit
resetBehavior ResetBehavior
return void

Reset() public method

public Reset ( ResetBehavior resetBehavior ) : void
resetBehavior ResetBehavior
return void

Reset() public method

public Reset ( string commitHash ) : void
commitHash string
return void

Reset() public method

public Reset ( string commitHash, ResetBehavior resetBehavior ) : void
commitHash string
resetBehavior ResetBehavior
return void

SwitchTo() public static method

Switch to the given branch
public static SwitchTo ( Branch branch ) : void
branch Branch
return void

ToString() public method

public ToString ( ) : string
return string