Command format
Git init [-q |--quiet] [--bare] [--template=<template_directory>]
[--separate-git-dir <git Dir>]
[--shared[=<permissions>]] [Directory]
Command parameters
--quiet,-Q
Quiet mode, only error and warning messages are printed.
Instance
A) Create a repository
[[email protected] git]$ mkdir hello_git[[email protected] git]$ CD Hello_git/[[email protected] hello_git]$ git Initiniti alized Empty Git repository in/home/ucm/git/hello_git/.git/
b) Creating a repository for an existing code base
[[email protected] git]$ mkdir hello_world[[email protected] git]$ echo-e ' #!/usr/bin/python\nprint ' Hello World ' > H Ello_world/hello.py[[email protected] git]$ chmod a+x hello_world/hello.py [[email protected] git]$ CD hello_world/[[ Email protected] hello_world]$ git initinitialized empty git repository in/home/huye/git/hello_world/.git/[[email Protected] hello_world]$ git Add. [[email protected] hello_world]$ git commit-m "Start a new git repository for an existing code base" [Master (Root-commit) B65BD46] Start A new Git repository for an existing code base 1 files changed, 2 insertions (+), 0 deletions (-) Create MoD E 100755 hello.py
More
Http://git-scm.com/docs/git-init
Git cmd-init:create an empty Git repository or reinitialize an existing one