git-init - Create an empty git repository or reinitialize an existing one
Inheritance: AbstractCommand
        /// <summary>
        /// Initializes a repository. Use GitDirectory to specify the location. Default is the current directory.
        /// </summary>
        /// <param name="path"></param>
        /// <param name="bare"></param>
        /// <returns></returns>
        public static Repository Init(string path, bool bare)
        {
            var cmd = new InitCommand()
            {
                GitDirectory = path, Bare = bare
            };

            return(Init(cmd));
        }
Beispiel #2
0
        public void Init()
        {
            //Initializing a new repository in the current directory (if GID_DIR environment variable is not set)
            Git.Init(".");

            //Initializing a new repository in the specified location
            Git.Init("path/to/repo");

            //Initializing a new repository with options
            var cmd = new InitCommand {
                GitDirectory = "path/to/repo", Quiet = false, Bare = true
            };

            cmd.Execute();
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a repository in the current location using the provided git command's options.
 /// </summary>
 /// <param name="cmd"></param>
 /// <returns></returns>
 public static Repository Init(InitCommand cmd)
 {
     cmd.Execute();
     return cmd.Repository;
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a repository. Use GitDirectory to specify the location. Default is the current directory.
 /// </summary>
 /// <param name="path"></param>
 /// <param name="bare"></param>
 /// <returns></returns>
 public static Repository Init(string path, bool bare)
 {
     var cmd = new InitCommand() { GitDirectory=path, Bare = bare };
     return Init(cmd);
 }
Beispiel #5
0
 public static void Init(InitCommand command)
 {
     command.Execute();
 }
 /// <summary>
 /// Initializes a repository in the current location using the provided git command's options.
 /// </summary>
 /// <param name="cmd"></param>
 /// <returns></returns>
 public static Repository Init(InitCommand cmd)
 {
     cmd.Execute();
     return(cmd.Repository);
 }
Beispiel #7
0
 public static void Init(InitCommand command)
 {
     command.Execute();
 }