[−][src]Struct rustygit::Repository
A local git repository
Implementations
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 remove(&self, pathspecs: Vec<&str>, force: bool) -> Result<()>
[src]
Remove file contents from 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]
&self,
upstream: &str,
upstream_branch: &BranchName
) -> Result<()>
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: &BranchName,
startpoint: &str
) -> Result<()>
[src]
&self,
branch_name: &BranchName,
startpoint: &str
) -> Result<()>
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
pub fn list_added(&self) -> Result<Vec<String>>
[src]
List files added to staging area
pub fn list_modified(&self) -> Result<Vec<String>>
[src]
List all modified files
pub fn list_untracked(&self) -> Result<Vec<String>>
[src]
List all untracked files
pub fn list_tracked(&self) -> Result<Vec<String>>
[src]
List tracked files
pub fn get_hash(&self, short: bool) -> Result<String>
[src]
Obtains commit hash of the current HEAD
.
Auto Trait Implementations
impl RefUnwindSafe for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl UnwindSafe for Repository
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,