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的入门使用操作的更多相关文章

  1. GIT 从入门到放弃大整理

    跟着廖雪峰学 GIT  http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000 GUI f ...

  2. 第三章 Git的入门 - 读书笔记

    Android驱动月考3 第三章 Git的入门 - 读书笔记 对于Github,这是全世界最大的开源平台,你可以把你做的项目在这里开源,把你发现的一些新技术在这里开源,向全世界的开发者们分享,大家都彼 ...

  3. Android系统移植与驱动开发--第三章 Git使用入门及在学习中有感

    第三章 Git使用入门 使用Git的目的是减少各种版本的Linux的压缩大小,提供源代码在Linux上进行编译. 在这一个章节中,其实就是关键步骤的操作,虽然Git与我们学习的android没有很大的 ...

  4. Git快速入门进阶篇

    本文接着Git快速入门篇,继续探讨Git在管理项目中的一些应用. 远程仓库的使用 查看远程仓库 查看你已经配置的远程仓库服务器,可以运行 git remote 命令.指定选项 -v,会显示需要读写远程 ...

  5. git快速入门 push/clone/reset/merge/切换分支全都有

    本文介绍git快速入门,从安装/创建init / 发布push/版本回退reset / branch分支切换/合并分支merge 这些基本的操作都有涉及,方便新人快速入手,有需要的朋友mark一下.首 ...

  6. Git 快速入门--Git 基础

    Git 快速入门 Git 基础 那么,简单地说,Git 究竟是怎样的一个系统呢? 请注意接下来的内容非常重要,若你理解了 Git 的思想和基本工作原理,用起来就会知其所以然,游刃有余. 在开始学习 G ...

  7. Git原理入门简析

    为了获得更好的阅读体验,建议访问原地址:传送门 前言: 之前听过公司大佬分享过 Git 原理之后就想来自己总结一下,最近一忙起来就拖得久了,本来想塞更多的干货,但是不喜欢拖太久,所以先出一版足够入门的 ...

  8. Git原理入门解析

    前言: 之前听过公司大佬分享过 Git 原理之后就想来自己总结一下,最近一忙起来就拖得久了,本来想塞更多的干货,但是不喜欢拖太久,所以先出一版足够入门的: 一.Git 简介 Git 是当前流行的分布式 ...

  9. git新手入门问题总结

    git新手入门问题总结 前言 本人为2019年6月份刚刚毕业,大三暑假中旬来到上海,实习时间大致为十个月,在这十个月里面学到了许多关于git使用方面的知识 经常会逛开源中国水水动态,看看技术帖子学习知 ...

随机推荐

  1. POJ 2337 输出欧拉路径

    太无语了. 这道题做了一整天. 主要还是我太弱了. 以后这个就当输出欧拉路径的模版吧. 题目中的输出字典序最小我有点搞不清楚,看了别人是这么写的.但是我发现我过不了后面DISCUSS里面的数据. 题意 ...

  2. jQuery中的DOM操作《思维导图》

    首先,是关于jQuery中的DOM操作的<思维导图>,请点击这里:jQuery中的DOM操作 列表框的左右选项移动 <html> <head> <title& ...

  3. 个人计算机安装hadoop全分布

    一.工具说明 设备:实体主机一台 校园网络 虚拟设备:VMware下安装的ubuntu12.04版本三台,分别是master,slave1,slave2 二.ubuntu安装篇 前提知识:在windo ...

  4. WPF专业编程指南 - 那些根元素<>的解释

    <Window x:Class="Chapter1_WpfApplication1.MainWindow" xmlns="http://schemas.micros ...

  5. 迟到的 WPF 学习 —— 入门

    之所以说"迟到的",是因为我太晚才开始学习 WPF 了,之前 WPF 刚发布的时候有过粗浅了解,那时的 WPF 还非常简陋,VS 提供的内置控件十分匮乏,让我这样的非常依赖 Win ...

  6. 关于MyEclipse SVN显示资源历史记录乱码问题

    使用SVN查看历史记录进行文件对比的时候,有时会出现乱码问题,如下图: 解决办法:打开Window-->Preferences 如下: 原来默认的是GBK,改为UTF-8即可

  7. CNN for Visual Recognition (01)

    CS231n: Convolutional Neural Networks for Visual Recognitionhttp://vision.stanford.edu/teaching/cs23 ...

  8. Go Revel 学习指南

    Go Revel 学习指南 CONTROLLERS(控制器) Routing(路由)http://www.cnblogs.com/hangxin1940/p/3267065.html Paramete ...

  9. SpringMVC入门笔记一

    SpringMVC优势    性能比struts2好    简单 便捷 易学    和Spring无缝集成(使用spring ioc aop)    约定优于配置    能够简单进行Junit测试   ...

  10. Spring Data Rest 支持Put请求

    最近在用 Spring Data Rest 写WebApi 遇到Put请求后报415 Mieda Type 的错误,GG了下 找到个解决办法,下面是针对Put请求的过滤. 1 public class ...