命令格式

git init [-q | --quiet] [--bare] [--template=<template_directory>]
    [--separate-git-dir <git dir>]
    [--shared[=<permissions>]] [directory]

命令参数

--quiet, -q
  安静模式,只打印错误和警告信息。

实例

a) 创建版本库

[huey@huey-K42JE git]$ mkdir hello_git
[huey@huey-K42JE git]$ cd hello_git/
[huey@huey-K42JE hello_git]$ git init
Initialized empty Git repository in /home/ucm/git/hello_git/.git/

b) 为已存在的代码库创建版本库

[huey@huey-K42JE git]$ mkdir hello_world
[huey@huey-K42JE git]$ echo -e '#!/usr/bin/python\nprint "hello world"' > hello_world/hello.py
[huey@huey-K42JE git]$ chmod a+x hello_world/hello.py
[huey@huey-K42JE git]$ cd hello_world/
[huey@huey-K42JE hello_world]$ git init
Initialized empty Git repository in /home/huye/git/hello_world/.git/
[huey@huey-K42JE hello_world]$ git add .
[huey@huey-K42JE 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 mode 100755 hello.py

更多

http://git-scm.com/docs/git-init

Git CMD - init: Create an empty Git repository or reinitialize an existing one的更多相关文章

  1. Git CMD - add: Record changes to the repository

    命令格式 git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend] [--dry-run] [(-c ...

  2. Git CMD - tag: Create, list, delete or verify a tag object signed with GPG

    命令格式 git tag [-a | -s | -u <keyid>] [-f] [-m <msg> | -F <file>] <tagname> [& ...

  3. 指定文件夹 指定文件后缀名 删除整个文件夹 git 冲突解决 create a new repository on the command line push an existing repository from the command line

    http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/001375840038939c2 ...

  4. Git CMD - clone: Clone a repository into a new directory

    命令格式 git clone [--template=<template_directory>]  [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare ...

  5. Git CMD连接,管理(remote,add,commit,push)github repository

    git initmd testcd testgit statusgit add test  //git add test/a.txtgit status git remote add origin g ...

  6. git clone all branch and create a empty branch

    /******************************************************************** * git clone all branch and cre ...

  7. Git CMD - config: Get and set repository or global options

    命令参数 --get 获取指定的配置项. --global 对于写选项:全局配置,将参数配置于 ~/.gitconfig 而不是仓库目录下的 .git/config.对于读选项:只从 ~/.gitco ...

  8. Git CMD - branch: List, create, or delete branches

    命令格式 git branch [--color[=<when>] | --no-color] [-r | -a] [--list] [-v [--abbrev=<length> ...

  9. git错误:fatal: Not a git repository (or any of the parent directories): .git

    git错误:fatal: Not a git repository (or any of the parent directories): .git 我用git add file添加文件时出现这样错误 ...

随机推荐

  1. [5] Zygote

    Android设备中的两大进程,如下图 1,由init进程创建的Daemon进程 2,由 Zygote进程创建的应用程序进程 什么是Zygote? zygote是“受精卵”的意思.在Android里, ...

  2. [Oralce]Oralce格式化日期

    字符串转日期 1.to_date(日期,'yyyyMMdd') 2.to_date(日期,'yyyyMMdd hh24miss')日期转字符串 TO_CHAR(SYSDATE, 'YYYY-MM-DD ...

  3. CodeForces 732B Cormen — The Best Friend Of a Man (贪心)

    题意:给定n和k表示,狗要在任意连续两天散步次数要至少为k,然后就是n个数,表示每天的时间,让你增加最少次数使得这个条件成立. 析:贪心,策略是从开始到最后暴力,每次和前面一个相比,如果相加不够k,那 ...

  4. TypeScript学习笔记(一):介绍及环境搭建

    官网 TypeScript目前还在快速的发展中,当前的版本是1.6,有关TypeScript更多的信息可以在其官网中获取. http://www.typescriptlang.org/ 什么是Type ...

  5. Elasticsearch集群搭建

    现有两部机器:192.168.31.86,192.168.31.87   参考以往博文对Elasticsearch进行配置完成:http://www.cnblogs.com/zhongshengzhe ...

  6. LeetCode: Word Break II [140]

    [题目] Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where ...

  7. linux php开启openssl

    1.测试openssl是否安装查看版本  openssl version查看路径  which openssl2.因为要扩展php扩展模块,所以要通过phpize可以建立php的外挂模块find / ...

  8. 关于在android手机中腾讯、阿里产品不自定义虚拟键盘的想法

    1,自定义虚拟键盘,影响用户体验.你每个用户的喜好不一样,都有自己心仪的一款输入法.腾讯或是阿里设计出来的输入法很难满足上亿用户的喜好,到时候又是一场口水战,再说了就是专业的输入法肯定要比应用里嵌套的 ...

  9. IDispatch接口 - GetIDsOfNames和Invoke(转)

    IDispatch接口是COM自动化的核心.其实,IDispatch这个接口本身也很简单,只有4个方法: IDispatch : public IUnknown { public: virtual H ...

  10. 使用asp.net动态添加html元素

    HtmlGenericControl gen = new HtmlGenericControl("div");        gen.InnerText = "HtmlG ...