git的入门使用操作
Git
*:first-child {
margin-top: 0 !important;
}
body>*:last-child {
margin-bottom: 0 !important;
}
/* BLOCKS
=============================================================================*/
p, blockquote, ul, ol, dl, table, pre {
margin: 15px 0;
}
/* HEADERS
=============================================================================*/
h1, h2, h3, h4, h5, h6 {
margin: 20px 0 10px;
padding: 0;
font-weight: bold;
-webkit-font-smoothing: antialiased;
}
h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code {
font-size: inherit;
}
h1 {
font-size: 28px;
color: #000;
}
h2 {
font-size: 24px;
border-bottom: 1px solid #ccc;
color: #000;
}
h3 {
font-size: 18px;
}
h4 {
font-size: 16px;
}
h5 {
font-size: 14px;
}
h6 {
color: #777;
font-size: 14px;
}
body>h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h4:first-child, body>h5:first-child, body>h6:first-child {
margin-top: 0;
padding-top: 0;
}
a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 {
margin-top: 0;
padding-top: 0;
}
h1+p, h2+p, h3+p, h4+p, h5+p, h6+p {
margin-top: 10px;
}
/* LINKS
=============================================================================*/
a {
color: #4183C4;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* LISTS
=============================================================================*/
ul, ol {
padding-left: 30px;
}
ul li > :first-child,
ol li > :first-child,
ul li ul:first-of-type,
ol li ol:first-of-type,
ul li ol:first-of-type,
ol li ul:first-of-type {
margin-top: 0px;
}
ul ul, ul ol, ol ol, ol ul {
margin-bottom: 0;
}
dl {
padding: 0;
}
dl dt {
font-size: 14px;
font-weight: bold;
font-style: italic;
padding: 0;
margin: 15px 0 5px;
}
dl dt:first-child {
padding: 0;
}
dl dt>:first-child {
margin-top: 0px;
}
dl dt>:last-child {
margin-bottom: 0px;
}
dl dd {
margin: 0 0 15px;
padding: 0 15px;
}
dl dd>:first-child {
margin-top: 0px;
}
dl dd>:last-child {
margin-bottom: 0px;
}
/* CODE
=============================================================================*/
pre, code, tt {
font-size: 12px;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}
code, tt {
margin: 0 0px;
padding: 0px 0px;
white-space: nowrap;
border: 1px solid #eaeaea;
background-color: #f8f8f8;
border-radius: 3px;
}
pre>code {
margin: 0;
padding: 0;
white-space: pre;
border: none;
background: transparent;
}
pre {
background-color: #f8f8f8;
border: 1px solid #ccc;
font-size: 13px;
line-height: 19px;
overflow: auto;
padding: 6px 10px;
border-radius: 3px;
}
pre code, pre tt {
background-color: transparent;
border: none;
}
kbd {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background-color: #DDDDDD;
background-image: linear-gradient(#F1F1F1, #DDDDDD);
background-repeat: repeat-x;
border-color: #DDDDDD #CCCCCC #CCCCCC #DDDDDD;
border-image: none;
border-radius: 2px 2px 2px 2px;
border-style: solid;
border-width: 1px;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
line-height: 10px;
padding: 1px 4px;
}
/* QUOTES
=============================================================================*/
blockquote {
border-left: 4px solid #DDD;
padding: 0 15px;
color: #777;
}
blockquote>:first-child {
margin-top: 0px;
}
blockquote>:last-child {
margin-bottom: 0px;
}
/* HORIZONTAL RULES
=============================================================================*/
hr {
clear: both;
margin: 15px 0;
height: 0px;
overflow: hidden;
border: none;
background: transparent;
border-bottom: 4px solid #ddd;
padding: 0;
}
/* TABLES
=============================================================================*/
table th {
font-weight: bold;
}
table th, table td {
border: 1px solid #ccc;
padding: 6px 13px;
}
table tr {
border-top: 1px solid #ccc;
background-color: #fff;
}
table tr:nth-child(2n) {
background-color: #f8f8f8;
}
/* IMAGES
=============================================================================*/
img {
max-width: 100%
}
-->
Git的使用
配置使用人的账号和邮箱
git config --global user.name zhufengzhufeng
git config --global user.email xxxxx
git config --list 查看所有配置
mkdir 创建目录
初始化git
git init
初始化文件
echo hello > index.txt 覆盖写入
echo hello word >> index.txt 写入
cat index.txt 查看文本里的内容
一个大于号表示清空并写入 >> 表示 追加
删除文件rm
查看状态 git status
将文件加入到暂存区中
git add file git add ./git add -A
提交commit
git commit -m"first"
vi控制台
如果进入编辑模式可以i键进入插入模式
- i表示编辑
- 退出esc + :wq
查看版本库信息
git log --oneline 查看版本库信息
git reflog 查看未来的版本
比较代码差异
git diff 比较工作区和暂存区的区别
git diff master 比较工作区和版本库的区别
git diff --cached 比较暂存区和版本库的区别
从暂存区删除本次的add
git reset HEAD <file>
取消本次的add
从缓存区 从历史区将代码覆盖掉工作区
git checkout <file>
回到过去
git reset --hard commit_id/HEAD^^^^^^^/HEAD~6
分支
查看所有分支git branch
创建分支git branch dev
切换分支git checkout dev
创建并切换git checkout -b fixbug
删除分支git branch -d dev
合并分支git merge 分支名
在主干上拉取一条分支,在分支上进行开发,开发后,在主干上将代码进行合并,主干上目前没有人开发,可以使用快转的方式,将我们的指针直接指向到分支的最新装态 fast-forward
在github上部署静态页
需要将特定的内容推送到github上的gh-pages分支上
- 创建一个gh-pages的分支
git checkout -b gh-pages - 将代码commit 到这个分支上
git add . git commit -m 'ok' - 连接远程仓库和本地仓库
git remote add aaa 地址 - 将代码推送到远程仓库上
git push aaa gh-pages
合并分支产生冲突
git log --graph --oneline --decorate 查看
合并分支产生冲突
- 在主干的某个版本上进行分支开发,在分支上开发1.txt这个文件(drag),在主干上也开发1.txt(limit),此时回到主干上合并时,会产生冲突,需要我们手动解决
从工作区中提交到历史区
git commit -a -m'drag'
解决冲突
去掉>>>>>> ======== <<<<<<< 保留需要的内容再次提交
合并
git rebase 变基 git cherry-pick 精选
显示结构
git log --graph --oneline --decorate
创建忽略文件
将项目提交到github上,需要在github上创建一个空的仓库
添加远程仓库的连接
git remote add 名字 地址
查看配置的所有配置的地址
git remote -v
删除地址
git remote rm 名字
upstream
-u 下次提交或者拉取代码可以直接git push 或者git pull
git的入门使用操作的更多相关文章
- GIT 从入门到放弃大整理
跟着廖雪峰学 GIT http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000 GUI f ...
- 第三章 Git的入门 - 读书笔记
Android驱动月考3 第三章 Git的入门 - 读书笔记 对于Github,这是全世界最大的开源平台,你可以把你做的项目在这里开源,把你发现的一些新技术在这里开源,向全世界的开发者们分享,大家都彼 ...
- Android系统移植与驱动开发--第三章 Git使用入门及在学习中有感
第三章 Git使用入门 使用Git的目的是减少各种版本的Linux的压缩大小,提供源代码在Linux上进行编译. 在这一个章节中,其实就是关键步骤的操作,虽然Git与我们学习的android没有很大的 ...
- Git快速入门进阶篇
本文接着Git快速入门篇,继续探讨Git在管理项目中的一些应用. 远程仓库的使用 查看远程仓库 查看你已经配置的远程仓库服务器,可以运行 git remote 命令.指定选项 -v,会显示需要读写远程 ...
- git快速入门 push/clone/reset/merge/切换分支全都有
本文介绍git快速入门,从安装/创建init / 发布push/版本回退reset / branch分支切换/合并分支merge 这些基本的操作都有涉及,方便新人快速入手,有需要的朋友mark一下.首 ...
- Git 快速入门--Git 基础
Git 快速入门 Git 基础 那么,简单地说,Git 究竟是怎样的一个系统呢? 请注意接下来的内容非常重要,若你理解了 Git 的思想和基本工作原理,用起来就会知其所以然,游刃有余. 在开始学习 G ...
- Git原理入门简析
为了获得更好的阅读体验,建议访问原地址:传送门 前言: 之前听过公司大佬分享过 Git 原理之后就想来自己总结一下,最近一忙起来就拖得久了,本来想塞更多的干货,但是不喜欢拖太久,所以先出一版足够入门的 ...
- Git原理入门解析
前言: 之前听过公司大佬分享过 Git 原理之后就想来自己总结一下,最近一忙起来就拖得久了,本来想塞更多的干货,但是不喜欢拖太久,所以先出一版足够入门的: 一.Git 简介 Git 是当前流行的分布式 ...
- git新手入门问题总结
git新手入门问题总结 前言 本人为2019年6月份刚刚毕业,大三暑假中旬来到上海,实习时间大致为十个月,在这十个月里面学到了许多关于git使用方面的知识 经常会逛开源中国水水动态,看看技术帖子学习知 ...
随机推荐
- 跨域访问 REST API
跨域访问 Web Service (REST API) 虽然 JQuery 也能通过授权header实现跨域, 但SharePoint 提供了更简单的方法,它被实现在SP.RequestExecuto ...
- 【学习笔记】锋利的jQuery(三)事件和动画
一.jQuery事件 1,加载事件 $(document).ready(function(){...}) //等同于$(function(){..}) $(window).load(function( ...
- storm搭建(1)zookeeper搭建
storm集群的安装我用了三台的虚拟机,ip分别是192.168.9.202和203和204,其中主机是202,两台分机的ip是203和204,之前两台机器的搭建已经完成,这次安装的环境是在204机器 ...
- PHP GD 库 缩略图 添加水印
class cls_image { var $error_no = 0; var $error_msg = ''; //var $images_dir = IMAGE_DIR; //var $data ...
- Linux内核中链表实现
关于双链表实现,一般教科书上定义一个双向链表节点的方法如下: struct list_node{ stuct list_node *pre; stuct list_node *next; ElemTy ...
- vs2015开发Windows服务
工作已经很久,时隔这么长时间写这篇文章是给自己以后做参考.也不至于以后长时间不写Windows服务而忘记整个开发过程.windows服务开发,基础的就不说了,直接上过程. 1.新建windows服务项 ...
- C#内获取泛型方法及扩展
C#内获取泛型方法及扩展 C#内我们可以通过反射来动态获取实例方法和静态方法,不管方法存在多少个重载都可以通过GetMethod内的第二个参数去筛选出所要获取的方法,代码如下: type.GetMet ...
- 彩蛋 Python之道
彩蛋 Python之道 作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留这段声明.谢谢! 使用下面的语句可以调出Python中的一个彩蛋, impo ...
- ThinkPHP中连接mysql数据库的四种实用和通用的连接方法
ThinkPHP内置了抽象数据库访问层,把不同的数据库操作封装起来,我们只需要使用公共的Db类进行操作,而无需针对不同的数据库写不同的代码和底层实现,Db类会自动调用相应的数据库适配器来处理.目前的数 ...
- Create Table DDL sample(TSQL)
IF EXISTS (SELECT 1 FROM sysobjects o, sysusers u WHERE o.uid=u.uid AND o.name = 'Table_Name' AND u. ...