Skip to content
nulltoken edited this page May 17, 2011 · 6 revisions

git-init

Create a new repository from a rooted path

Standard ".git" repository

Plain Git

$ git init /d/temp/rooted/path
Initialized empty Git repository in d:/rooted/path/.git/

LibGit2Sharp

string rootedPath = Repository.Init("D:\temp\rooted\path");

Console.WriteLine(rootedPath);    // "D:\temp\rooted\path\.git\\"

Bare repository

Plain Git

$ git init --bare /d/temp/rooted/path
Initialized empty Git repository in d:/rooted/path/

LibGit2Sharp

string rootedPath = Repository.Init("D:\temp\rooted\path", true);

Console.WriteLine(rootedPath);    // "D:\temp\rooted\path\\"
Clone this wiki locally