[][src]Struct rustygit::Repository

pub struct Repository { /* fields omitted */ }

A local git repository

Methods

impl Repository[src]

pub fn new<P: AsRef<Path>>(p: P) -> Repository[src]

Create a Repository struct from a pre-existing local git repository

pub fn clone<P: AsRef<Path>>(url: GitUrl, p: P) -> Result<Repository>[src]

Clone a remote git repository locally

pub fn init<P: AsRef<Path>>(p: P) -> Result<Repository>[src]

Initialise a given folder as a git repository

pub fn create_local_branch(&self, branch_name: &BranchName) -> Result<()>[src]

Create and checkout a new local branch

pub fn switch_branch(&self, branch_name: &BranchName) -> Result<()>[src]

Checkout the specified branch

pub fn add(&self, pathspecs: Vec<&str>) -> Result<()>[src]

Add file contents to the index

pub fn commit_all(&self, message: &str) -> Result<()>[src]

Commit all staged files

pub fn push(&self) -> Result<()>[src]

Push the curent branch to its associated remote

pub fn push_to_upstream(
    &self,
    upstream: &str,
    upstream_branch: &BranchName
) -> Result<()>
[src]

Push the curent branch to its associated remote, specifying the upstream branch

pub fn add_remote(&self, name: &str, url: &GitUrl) -> Result<()>[src]

Add a new remote

pub fn fetch_remote(&self, remote: &str) -> Result<()>[src]

Fetch a remote

pub fn create_branch_from_startpoint(
    &self,
    branch_name: &str,
    startpoint: &str
) -> Result<()>
[src]

Create a new branch from a start point, such as another local or remote branch

pub fn list_branches(&self) -> Result<Vec<String>>[src]

List local branches

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]