Git分支管理[三]
标签(linux): git
笔者Q:972581034 交流群:605799367。有任何疑问可与笔者或加群交流
git分支管理命令
git branch #创建分支
git branch -v #详细显示创建过程
git branch -merged #查看已融合过的分支
git branch --no-merged #查看哪些分支没有被融合
git branch -d testing #删除分支
git checkout #切换分支
git merge #融合分支
git log
git stash #做一个暂存区
git tag #打标记
创建一个分支
[root@git test]# git branch about
[root@git test]# git branch
about
* master
查看状态可发现还在master
[root@git test]# git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
news.html
pay.html
nothing added to commit but untracked files present (use "git add" to track)
切换到about分支
[root@git test]# git checkout about
Switched to branch 'about'
[root@git test]# git status
On branch about
Untracked files:
(use "git add <file>..." to include in what will be committed)
news.html
pay.html
nothing added to commit but untracked files present (use "git add" to track)
验证分支是否创建成功
[root@git test]# echo "about us" > about.html
[root@git test]# git add .
[root@git test]# git commit -m "about"
[about 2390a21] about
3 files changed, 3 insertions(+)
create mode 100644 about.html
create mode 100644 news.html
create mode 100644 pay.html
[root@git test]# git log
commit 2390a21f03a22ab4c9ae81de0736e1e9bbcdbebf
Author: chentiangang <chentiangang@yoho8.com>
Date: Fri Aug 18 00:16:36 2017 +0800
about
commit 145b100cd0e07a9e59e15cf71aad3338ed8a57a6
Author: chentiangang <chentiangang@yoho8.com>
Date: Thu Aug 17 23:42:32 2017 +0800
index.html
切回到master分支查看
[root@git test]# git log
commit 2390a21f03a22ab4c9ae81de0736e1e9bbcdbebf
Author: chentiangang <chentiangang@yoho8.com>
Date: Fri Aug 18 00:16:36 2017 +0800
about
commit 145b100cd0e07a9e59e15cf71aad3338ed8a57a6
Author: chentiangang <chentiangang@yoho8.com>
Date: Thu Aug 17 23:42:32 2017 +0800
index.html
[root@git test]# git checkout master
Switched to branch 'master'
[root@git test]# git log
commit 1cf6888d97b0a361a3daed01a06c67936bc4f241
Author: chentiangang <chentiangang@yoho8.com>
Date: Thu Aug 17 23:49:27 2017 +0800
first index:v2
commit 145b100cd0e07a9e59e15cf71aad3338ed8a57a6
Author: chentiangang <chentiangang@yoho8.com>
Date: Thu Aug 17 23:42:32 2017 +0800
index.html
融合分支
* 注意:如果是master想跟about融合,需要先切换到master然后执行命令
[root@git test]# git merge about
Merge branch 'about'
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
~
".git/MERGE_MSG" 7L, 248C written
Merge made by the 'recursive' strategy.
about.html | 1 +
about2.html | 1 +
news.html | 1 +
pay.html | 1 +
4 files changed, 4 insertions(+)
create mode 100644 about.html
create mode 100644 about2.html
create mode 100644 news.html
create mode 100644 pay.html

Git分支管理[三]的更多相关文章
- Git 分支管理是一门艺术
转载: Git 分支管理是一门艺术 1 要确保:团队成员从主分支(master)获得的都是处于可发布状态的代码,而从开发分支(develop)应该总能够获得最新开发进展的代码. 2 "辅助分 ...
- git分支管理与冲突解决(转载)
Git 分支管理和冲突解决 原文:http://www.cnblogs.com/mengdd/p/3585038.html 创建分支 git branch 没有参数,显示本地版本库中所有的本地分支名称 ...
- 团队项目的Git分支管理规范
原文地址: http://blog.jboost.cn/2019/06/17/git-branch.html 许多公司的开发团队都采用Git来做代码版本控制.如何有效地协同开发人员之间,以及开发.测试 ...
- Git工程开发实践(四)——Git分支管理策略
A successful Git branching model https://nvie.com/posts/a-successful-git-branching-model/ Git工程开发实践( ...
- 在Visual Studio 中使用git——分支管理-下(九)
在Visual Studio 中使用git--什么是Git(一) 在Visual Studio 中使用git--给Visual Studio安装 git插件(二) 在Visual Studio 中使用 ...
- Git 分支管理策略汇总
原文链接: Git 分支管理策略 最近,团队新入职了一些小伙伴,在开发过程中,他们问我 Git 分支是如何管理的,以及应该怎么提交代码? 我大概说了一些规则,但仔细想来,好像也并没有形成一个清晰规范的 ...
- GIT分支管理模型
GIT分支管理模型 link: git-branching-model 主分支(Main branches) 项目两个常驻分支: master 主干分支(锁定),仅用于发布新版本,平时不能在上面干活, ...
- Git 分支管理详解
大纲: 1.前言 2.创建分支 3.切换分支 4.合并分支(快速合并) 5.删除分支 6.分支合并冲突 7.合并分支(普通合并) 8.分支管理策略 9.团队多人开发协作 10.总结 注,测试机 Cen ...
- Git—分支管理
Git—分支管理 分支学习:branch称为分支,默认仅有一个名为master的分支.一般开发新功能流程为:开发新功能时会在分支dev上进行,开发完毕后再合并到master分支. branch相关常用 ...
随机推荐
- htm的常见布局
布局是CSS中一个重要部分,本文总结了CSS布局中的常用技巧,包括常用的水平居中.垂直居中方法,以及单列布局.多列布局的多种实现方式(包括传统的盒模型布局和比较新的flex布局实现),希望能给需要的小 ...
- C#学习笔记-抽象工厂模式
题目1:数据访问,通过数据库对用户表单的进行访问,数据库包含SQL Server,对用户表单进行“新增用户”和“查询用户”信息等操作. 分析: 首先,确认用户表单,里面包含两个ID和Name两个字段, ...
- 加载进度圈,带遮罩层(jquery)
如图: Js下载地址:http://files.cnblogs.com/files/holdon521/cvi_busy_lib.js 如下使用实例: <script src="/st ...
- kafka中partition和消费者对应关系
1个partition只能被同组的一个consumer消费,同组的consumer则起到均衡效果 消费者多于partition topic: test 只有一个partition 创建一个topic- ...
- CTF---Web入门第十一题 PHP大法
PHP大法分值:20 来源: DUTCTF 难度:中 参与人数:8205人 Get Flag:2923人 答题人数:3042人 解题通过率:96% 注意备份文件 解题链接: http://ctf5.s ...
- 洛谷 P1598 垂直柱状图【字符串+模拟】
P1598 垂直柱状图 题目描述 写一个程序从输入文件中去读取四行大写字母(全都是大写的,每行不超过72个字符),然后用柱状图输出每个字符在输入文件中出现的次数.严格地按照输出样例来安排你的输出格式. ...
- UVa 725 简单枚举+整数转换为字符串
Division Write a program that finds and displays all pairs of 5-digit numbers that between them use ...
- 详解:Python2中的urllib、urllib2与Python3中的urllib以及第三方模块requests
在python2中,urllib和urllib2都是接受URL请求的相关模块,但是提供了不同的功能.两个最显著的不同如下: 1.urllib2可以接受一个Request类的实例来设置URL请求的hea ...
- 【Keras】基于SegNet和U-Net的遥感图像语义分割
上两个月参加了个比赛,做的是对遥感高清图像做语义分割,美其名曰"天空之眼".这两周数据挖掘课期末project我们组选的课题也是遥感图像的语义分割,所以刚好又把前段时间做的成果重新 ...
- android studio升级2.3后出现的问题
报错: Error:Execution failed for task ':app:javaPreCompileDebug'. > Annotation processors must be e ...