The 3 options:
- Don't let git create the repo folder (by specifying it in the command line):
var process = new Process
{
StartInfo = new ProcessStartInfo()
{
FileName = "git",
Arguments = "clone https://repo/url c:/target/path/for/repo",
}
};
process.Start();
equivalent also to:
Process.start("git", "clone https://repo/url c:/target/path/for/repo");
But if you want to specify the working directory, you have to use ProcessStartInfo
class.
1.bis. Don't let git create the repo folder (by using the current working directory .
so you have to fill the WorkingDirectory
property):
var process = new Process
{
StartInfo = new ProcessStartInfo()
{
FileName = "git",
Arguments = "clone https://repo/url .",
WorkingDirectory = "c:/target/path/for/repo",
}
};
process.Start();
- Let git create the repo folder in the working directory folder provided:
var process = new Process
{
StartInfo = new ProcessStartInfo()
{
FileName = "git",
Arguments = "clone https://repo/url",
WorkingDirectory = "c:/target/path/for/repo",
}
};
process.Start();