Helps with a number of Git Operations
MarkdownMonster.Utilities.GitHelper
public class GitHelper : object, IDisposable
Class Members
Member | Description | |
---|---|---|
Constructor |
||
DefaultStatusesToDisplay |
||
AddRemote |
Adds a remote to the current Repository. Requires that you open a repository first public bool AddRemote(string githubUrl, Â Â Â Â string remoteName) |
|
Checkout |
Checks out a branch on an active repository public bool Checkout(string branch, Â Â Â Â string path) |
|
CloneRepositoryCommandLine |
Clones a repository using the Command Line Tooling. Provides built-in authentication UI. public GitCommandResult CloneRepositoryCommandLine(string gitUrl, Â Â Â Â string localPath, Â Â Â Â Action<Object,DataReceivedEventArgs> progress, Â Â Â Â int depth) |
|
Commit |
public bool Commit(ObservableCollection |
|
CreateBranch |
Creates a new branch and optionally checks it out public bool CreateBranch(string branch, Â Â Â Â string path, Â Â Â Â bool checkoutBranch) |
|
CreateRepository |
Creates a new repository which is the equivalent of a Git Init. public bool CreateRepository(string path, Â Â Â Â string gitIgnoreText) |
|
Dispose |
public sealed void Dispose() |
|
ExecuteGitCommand |
Executes a Git Command on the command line. Recommend that you only use this for Remote commands that require authentication so that the Windows Credentials Store can handle providing sticky Auth to Github, VSTS and BitBucket. public GitCommandResult ExecuteGitCommand(string arguments, Â Â Â Â string path, Â Â Â Â int timeoutMs, Â Â Â Â ProcessWindowStyle windowStyle, Â Â Â Â Action<Object,DataReceivedEventArgs> progress) |
|
FindGitExecutable |
Checks to see if Git is installed on the local machine public static string FindGitExecutable() |
|
FindGitRepositoryRoot |
public static string FindGitRepositoryRoot(string folder) |
|
GetActiveRemoteUrl |
Retrieves the active repository Remote URL public string GetActiveRemoteUrl() |
|
GetBranches |
Retrieves a listing of Branches public BranchCollection GetBranches(string path) |
|
GetComittedFileTextContent |
Returns the text content for the last commit of a file public string GetComittedFileTextContent(string path) |
|
GetGitNameAndEmailFromGitConfig |
Retrieves Username and Email as a two item array from .gitconfig file if it exists. public static String[] GetGitNameAndEmailFromGitConfig() |
|
GetGitStatusForFile |
Returns the Git file status for an individual file public FileStatus GetGitStatusForFile(string file) |
|
GetRepositoryChanges |
Sets the StatusItems property with all changed items public ObservableCollection |
|
GotoGitDownload |
Navigates browser to the Git Web download location public static void GotoGitDownload() |
|
IgnoreFile |
Adds an entry to the root .gitignore file if the the value doesn't already exist public bool IgnoreFile(string filePath) |
|
IsGitInstalled |
Determines whether Git is installed public static bool IsGitInstalled() |
|
Merge |
Merges changes from a branch into the current HEAD of the repository public bool Merge(string path, Â Â Â Â string mergeBranch, Â Â Â Â string name, Â Â Â Â string email) |
|
OpenDiffTool |
Opens the configured Diff tool for the provided file and allows comparison. public bool OpenDiffTool(string filePath) |
|
OpenRepository |
Opens a repository and stores it in the Repository property of this class public Repository OpenRepository(string localPath) |
|
Pull |
Pulls changes as a public bool Pull(string path, Â Â Â Â bool rebase, Â Â Â Â string branch) |
|
PullAsync |
public Task |
|
Push |
Pushes changes to the origin on the remote public bool Push(string path, Â Â Â Â string branch) |
|
PushAsync |
public Task |
|
UndoChanges |
Removes any changes since the last commit on the current active local branch public void UndoChanges(string file) |
|
CloneProgress |
||
ErrorMessage |
||
Repository |
Requirements
Namespace: MarkdownMonster.UtilitiesAssembly: markdownmonster.exe
© West Wind Technologies, 2016-2024 • Updated: 11/23/21
Comment or report problem with topic