首页 > 代码库 > GIT笔记命令行(1)

GIT笔记命令行(1)

Git简单易用,只要输入git就可以列出他的所有参数

技术分享
 1 C:\Users\spu>git
 2 usage: git [--version] [--help] [-C <path>] [-c name=value]
 3            [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
 4            [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
 5            [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
 6            <command> [<args>]
 7 
 8 These are common Git commands used in various situations:
 9 
10 start a working area (see also: git help tutorial)
11    clone      Clone a repository into a new directory
12    init       Create an empty Git repository or reinitialize an existing one
13 
14 work on the current change (see also: git help everyday)
15    add        Add file contents to the index
16    mv         Move or rename a file, a directory, or a symlink
17    reset      Reset current HEAD to the specified state
18    rm         Remove files from the working tree and from the index
19 
20 examine the history and state (see also: git help revisions)
21    bisect     Use binary search to find the commit that introduced a bug
22    grep       Print lines matching a pattern
23    log        Show commit logs
24    show       Show various types of objects
25    status     Show the working tree status
26 
27 grow, mark and tweak your common history
28    branch     List, create, or delete branches
29    checkout   Switch branches or restore working tree files
30    commit     Record changes to the repository
31    diff       Show changes between commits, commit and working tree, etc
32    merge      Join two or more development histories together
33    rebase     Reapply commits on top of another base tip
34    tag        Create, list, delete or verify a tag object signed with GPG
35 
36 collaborate (see also: git help workflows)
37    fetch      Download objects and refs from another repository
38    pull       Fetch from and integrate with another repository or a local branch
39 
40    push       Update remote refs along with associated objects
41 
42 ‘git help -a‘ and ‘git help -g‘ list available subcommands and some
43 concept guides. See ‘git help <command>‘ or ‘git help <concept>44 to read about a specific subcommand or concept.
View Code

git命令可以分为短和长选项。例如:

git commit  -m "hello git"

git commit --message="hello git"

以上两条命令式等价的

 

1.Git入门

有两种简历git版本库的技术。可以从头开始创建,用现有的内容填充它,或者可以clone一个已有的版本库,从一个空的版本库比较简单,所有从空的版本库开始吧。

 

  1.1 创建一个初始版本库

   1 mkdir ~/public_html 2 cd ~/public_html 3 echo ‘hello git‘ >index.html 

  

GIT笔记命令行(1)