Git cmd-init:create an empty Git repository or reinitialize an existing one

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.