Exemple #1
0
        public static async Task Init(string path)
        {
            _ = await CommandEx.ReadLoggedAsync("git", "init --initial-branch=main", path).ConfigureAwait(false);

            _ = await CommandEx.ReadLoggedAsync("git", "config user.email [email protected]", path).ConfigureAwait(false);

            _ = await CommandEx.ReadLoggedAsync("git", "config user.name John Doe", path).ConfigureAwait(false);

            _ = await CommandEx.ReadLoggedAsync("git", "config commit.gpgsign false", path).ConfigureAwait(false);
        }
Exemple #2
0
 public static Task Checkout(string path, string sha) =>
 CommandEx.ReadLoggedAsync("git", $"checkout {sha}", path);
Exemple #3
0
 public static async Task <IEnumerable <string> > GetCommitShas(string path) =>
 (await CommandEx.ReadLoggedAsync("git", "log --pretty=format:\"%H\"", path).ConfigureAwait(false)).StandardOutput.Split('\r', '\n');
Exemple #4
0
 public static Task AnnotatedTag(string path, string tag, string message) =>
 CommandEx.ReadLoggedAsync("git", $"tag {tag} -a -m '{message}'", path);
Exemple #5
0
 public static Task Tag(string path, string tag, string sha) =>
 CommandEx.ReadLoggedAsync("git", $"tag {tag} {sha}", path);
Exemple #6
0
 public static async Task <string> GetGraph(string path) =>
 (await CommandEx.ReadLoggedAsync("git", "log --graph --pretty=format:'%d'", path).ConfigureAwait(false)).StandardOutput;
Exemple #7
0
 public static Task Commit(string path) =>
 CommandEx.ReadLoggedAsync("git", "commit -m '.' --allow-empty", path);