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

 C:\Users\spu>git
usage: git [--version] [--help] [-C <path>] [-c name=value]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>] These are common Git commands used in various situations: start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize an existing one work on the current change (see also: git help everyday)
add Add file contents to the index
mv Move or rename a file, a directory, or a symlink
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index examine the history and state (see also: git help revisions)
bisect Use binary search to find the commit that introduced a bug
grep Print lines matching a pattern
log Show commit logs
show Show various types of objects
status Show the working tree status grow, mark and tweak your common history
branch List, create, or delete branches
checkout Switch branches or restore working tree files
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
merge Join two or more development histories together
rebase Reapply commits on top of another base tip
tag Create, list, delete or verify a tag object signed with GPG collaborate (see also: git help workflows)
fetch Download objects and refs from another repository
pull Fetch from and integrate with another repository or a local branch push Update remote refs along with associated objects 'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.

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

git commit  -m "hello git"

git commit --message="hello git"

以上两条命令式等价的

1.Git入门

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

  1.1 创建一个初始版本库

  

 mkdir ~\public
cd ~\public
echo 'hello git' > index.html
git init

  git init将public目录转化为了git版本库。

  git不关心你是从一个空白的目录还是一个装满目录的文件开始的。在这两种情况下将目录转换为GIT版本库是完全一样的。

  为了显示目录是一个git版本库。git init创建了一个隐藏的.git目录。git将所有修订信息都放在这唯一的顶层.git目录中。

  1.2 将文件添加进版本库

  

 git add index.html
git commit -m 'init'
git status

  如果目录中有很多文件,可以用git add . 来添加进版本库。

  git将add、remove和commit分开,以避免频繁的变化。

  add仅仅只是把改变暂存在了本地。commit才是上传了改变。

  

  在add后,如果运行git status 可以查看git下一次将会把index.html上传给版本库

  除了原数据以外,git每次提交的时候,还会包括一些元数据,类似日志信息和作出本次变更的作者。

 

  如果仅仅只是运行git commit ,系统会调用设定好的编辑器来让你编辑

  

  

GIT笔记命令行(1)的更多相关文章

  1. git常用命令行总结

    Git是当今最流行的版本控制工具.这几年GitHub也干掉了GoogleCode和Sourceforge,从三大代码仓库中脱颖而出,除了GitHub自身的优秀外,Git也是功不可没. 为何Git如此出 ...

  2. git 在命令行与图形状态下使用详情

    http://blog.csdn.net/risky78125/article/details/50850545 http://blog.csdn.net/risky78125/article/det ...

  3. git 常用命令行操作

    git常用命令行操作: 点击 git bash 进入到命令行: git clone https://github.com/wlz1244/qingoo.git   //下载一个master分支代码 g ...

  4. Git终端命令行的常用操作

    一.git源代码管理的优点 方便多人协同开发.工作 降低代码的管理成本 良好的分支管理机制 二.结构分析 服务端和客户端都有版本控制能力,都能进行代码的提交.合并 结构一: 结构二: 三.工作区的创建 ...

  5. 使用github的使用,利用git shell命令行模式进行操作

    一.登录到git,新建一个版本仓库 二.在"Repository name"一栏里填写版本仓库的名称,如"test",Description栏是描述,可填可不填 ...

  6. git bash命令行使用https协议方式进行克隆和提交到github服务器

    在本地创建一个文件夹来存放远程服务器仓库:如创建一个git8文件夹: 在命令行中,使用git clone https://github.com/serverking/weixin.git进行克隆git ...

  7. github的使用,利用git shell命令行创建仓库并上传

    一.登录到github,新建一个版本仓库 二.在“Repository name”一栏里填写版本仓库的名称,如”test”,Description栏是描述,可填可不填. 默认访问权限为公共,点击”Cr ...

  8. Git补充命令行操作操作

    Git命令行基本操作这里有我之前整理的git基本操作,常用的操作. 本文以实际功能和实例来说明git GUI的实现原理. 单独更新特定文件 $ git checkout readme.md 删除特定文 ...

  9. Windows Git Bash命令行下创建git仓库并更新到github

    大二的时候就听过老师说有一个叫git的版本管理工具,当时只是听老师说说而已,也没有去使用它,因为当时用过svn,就感觉自己没多少东西需要git管理. 最近几天,我经常在开源中国看别人的帖子,看到别人对 ...

随机推荐

  1. HTTPS 互联网世界的安全基础

    近一年公司在努力推进全站的 HTTPS 化,作为负责应用系统的我们,在配合这个趋势的过程中,顺便也就想去搞清楚 HTTP 后面的这个 S 到底是个什么含义?有什么作用?带来了哪些影响?毕竟以前也就只是 ...

  2. 发布:.NET开发人员必备的可视化调试工具(你值的拥有)

    1:如何使用 1:点击下载:.NET可视化调试工具 (更新于2016-12-29 19:11:00) (终于彻底兼容了部分VS环境下无法使用的问题) 2:解压RAR后执行:CYQ.VisualierS ...

  3. 数据库的快照隔离级别(Snapshot Isolation)

    隔离级别定义事务处理数据读取操作的隔离程度,在SQL Server中,隔离级别只会影响读操作申请的共享锁(Shared Lock),而不会影响写操作申请的互斥锁(Exclusive Lock),隔离级 ...

  4. 利用CSS中的:after、: before制作的边三角提示框

    小颖昨天分享了一篇参考bootstrap中的popover.js的css画消息弹框今天给大家再分享一篇使用:before和:after伪元素画消息弹框的CSS. 画出来是介个酱紫的: 有没有觉得画的萌 ...

  5. 步入angularjs directive(指令)--准备工作熟悉hasOwnProperty

    在讲解directive之前,先做一下准备工作,为何要这样呢? 因为我们不是简单的说说directive怎么用,还要知道为什么这么用!(今天我们先磨磨刀!). 首先我们讲讲js 基础的知识--hasO ...

  6. 微软开源代码编辑器monaco-editor

    官网上给出:”The Monaco Editor is the code editor that powers VS Code. A good page describing the code edi ...

  7. PLSql Oracle配置

    1.安装Oracle客户端或者服务端 2.配置环境变量 <1>.一般如果安装了Oracle客户端或者服务端的话,在环境变种的Path中有Oracle的安装路径(计算机-属性-高级系统设置- ...

  8. No plugin found for prefix ‘jetty’ in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories

    maven配置文件(最大的那个)的<pluginGroups></pluginGroups>增加一行如下<pluginGroups><pluginGroup& ...

  9. EF里Guid类型数据的自增长、时间戳和复杂类型的用法

    通过前两章Lodging和Destination类的演示,大家肯定基本了解Code First是怎么玩的了,本章继续演示一些很实用的东西.文章的开头提示下:提供的demo为了后面演示效果,前面代码有些 ...

  10. 在ASP.NET MVC 4 on Mono中使用OracleClient in CentOS 6.x的问题记录

    在ASP.NET MVC 4 on Mono中使用OracleClient in CentOS 6.x的问题记录 前言 最近有个Web项目,业务功能不复杂,但是这个客户(某政府部门)有两个硬性要求:1 ...