GIT笔记命令行(1)
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)的更多相关文章
- git常用命令行总结
Git是当今最流行的版本控制工具.这几年GitHub也干掉了GoogleCode和Sourceforge,从三大代码仓库中脱颖而出,除了GitHub自身的优秀外,Git也是功不可没. 为何Git如此出 ...
- git 在命令行与图形状态下使用详情
http://blog.csdn.net/risky78125/article/details/50850545 http://blog.csdn.net/risky78125/article/det ...
- git 常用命令行操作
git常用命令行操作: 点击 git bash 进入到命令行: git clone https://github.com/wlz1244/qingoo.git //下载一个master分支代码 g ...
- Git终端命令行的常用操作
一.git源代码管理的优点 方便多人协同开发.工作 降低代码的管理成本 良好的分支管理机制 二.结构分析 服务端和客户端都有版本控制能力,都能进行代码的提交.合并 结构一: 结构二: 三.工作区的创建 ...
- 使用github的使用,利用git shell命令行模式进行操作
一.登录到git,新建一个版本仓库 二.在"Repository name"一栏里填写版本仓库的名称,如"test",Description栏是描述,可填可不填 ...
- git bash命令行使用https协议方式进行克隆和提交到github服务器
在本地创建一个文件夹来存放远程服务器仓库:如创建一个git8文件夹: 在命令行中,使用git clone https://github.com/serverking/weixin.git进行克隆git ...
- github的使用,利用git shell命令行创建仓库并上传
一.登录到github,新建一个版本仓库 二.在“Repository name”一栏里填写版本仓库的名称,如”test”,Description栏是描述,可填可不填. 默认访问权限为公共,点击”Cr ...
- Git补充命令行操作操作
Git命令行基本操作这里有我之前整理的git基本操作,常用的操作. 本文以实际功能和实例来说明git GUI的实现原理. 单独更新特定文件 $ git checkout readme.md 删除特定文 ...
- Windows Git Bash命令行下创建git仓库并更新到github
大二的时候就听过老师说有一个叫git的版本管理工具,当时只是听老师说说而已,也没有去使用它,因为当时用过svn,就感觉自己没多少东西需要git管理. 最近几天,我经常在开源中国看别人的帖子,看到别人对 ...
随机推荐
- JS调用Android、Ios原生控件
在上一篇博客中已经和大家聊了,关于JS与Android.Ios原生控件之间相互通信的详细代码实现,今天我们一起聊一下JS调用Android.Ios通信的相同点和不同点,以便帮助我们在进行混合式开发时, ...
- 微软.NET Core RC2正式发布,横跨所有平台
.NET官方博客宣布了<Announcing .NET Core RC2 and .NET Core SDK Preview 1>,正式如期发布了.NET Core RC2, 现在可以放心 ...
- 【组织级项目管理】P2 MSP P3O
组织级项目管理--有你,有我,有大家 在过去的2年,无论对于企业来讲,还是对于我们个人都有很多大脑的冲击,有几个词大家应该特别耳熟能详:转型,变革,敏捷,互联网+,组织的项目化管理等.就是这些让我们的 ...
- 使用webstorm+webpack构建简单入门级“HelloWorld”的应用&&引用jquery来实现alert
使用webstorm+webpack构建简单入门级"HelloWorld"的应用&&构建使用jquery来实现 1.首先你自己把webstorm安装完成. 请参考这 ...
- [APUE]文件和目录(中)
一.link.unlink.remove和rename 一个文件可以有多个目录项指向其i节点.使用link函数可以创建一个指向现存文件连接 #include <unistd.h> int ...
- Linux 添加新磁盘,在线扩充空间
CentOS 7开发环境中的home 目录空间满了,需要增加空间 到虚拟机上执行"ls /sys/class/scsi_host",然后重新扫描SCSI总线来添加设备.如右图.然后 ...
- spider RPC入门指南
本部分将介绍使用spider RPC开发分布式应用的客户端和服务端. spider RPC中间件基于J2SE 8开发,因此需要确保服务器上安装了JDK 8及以上版本,不依赖于任何额外需要独立安装和配置 ...
- 微信小程序教程汇总
目前市面上在内测期间出来的一些实战类教程还是很不错的,主要还是去快速学习小程序开发的整体流程,一个组件一个组件的讲的很可能微信小程序一升级,这个组件就变了,事实本就如此,谁让现在是内测呢.我们不怕,下 ...
- Jquery 获得当前标签的名称和标签属性
得到标签的名称 $("#name").prop("tagName"); 或者 $("#name")[0].tagName; 注意:1.得到的 ...
- Linux:将rhel yum 切换到centos yum
Red Hat Enterprise Linux Server(RHEL) yum安装软件时This system is not registered with RHN. RHN support wi ...