/// <summary> /// clones a remote repository to the provided git workspace /// </summary> public static string CloneScript(RepoDetails rd, ServerDetails sd) { string[] lines = new string[] { "cd /D " + rd.GetLocal(), // jump to local workspace "git clone " + rd.GetRemote(), // clone remote repo "exit" }; FileUtil.WriteToFileUTF8("clone.bat", lines); return(DefaultLogin("clone", sd)); }
/// <summary> /// new a script to create a new local repository /// </summary> public static string NewScript(RepoDetails rd) { string[] lines = new string[] { "cd /D " + rd.GetLocal(), // jump to folder "git init", // initialize the folder as a git repository "git remote add " + rd.GetName() + " " + rd.GetRemote(), // add a reference to the remote repository "exit" }; FileUtil.WriteToFileUTF8("new.bat", lines); return(DefaultExecution("new")); }