~/Desktop/work/movies/movie(apps) $ git status  //先查看是否有需要提交的东西
# On branch apps
nothing to commit (working directory clean)
~/Desktop/work/movies/movie(apps) $ git checkout master //切换到主干
Switched to branch 'master'
~/Desktop/work/movies/movie(master) $ git status  //查看主干是否有需要提交的东西
# On branch master
nothing to commit (working directory clean)
~/Desktop/work/movies/movie(master) $ git pull  //再次确认是否需要更新代码查看主干是否有需要提交的东西
Already up-to-date.

~/Desktop/work/movies/movie(master) $ git checkout apps //切换到分支

Switched to branch 'apps'

~/Desktop/work/movies/movie(apps) $ git rebase master//拷贝主干最新内容
Current branch apps is up to date.
~/Desktop/work/movies/movie(apps) $ git checkout master //切换到主干
Switched to branch 'master'

~/Desktop/work/movies/movie(master) $ git merge apps //合并分支
Updating e6ba441..9bc179d
Fast-forward
 .../Classes/UI/Film/FilmListController.m           |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
~/Desktop/work/movies/movie(master) $ git branch
  apps
* master
~/Desktop/work/movies/movie(master) $ git apps
git: 'apps' is not a git command. See 'git --help'.

Did you mean this?
apply
~/Desktop/work/movies/movie(master) $ git checkout apps
Switched to branch 'apps'
~/Desktop/work/movies/movie(apps) $

 
 
转自:http://www.cnblogs.com/-yun/p/4794973.html
 

git分支主干的更多相关文章

  1. Git 分支 主干

    ~/Desktop/work/movies/movie(apps) $ git status  //先查看是否有需要提交的东西# On branch appsnothing to commit (wo ...

  2. git分支与主干合并操作

    git分支与主干合并操作1.主干合并分支在主干上合并分支 branch (master)git merge branch --squash 提交合并后的代码 (master)git commit -m ...

  3. Git分支的前世今生

    摘自Jack__CJ  CSDN博客,写得很好,保存一下. 导读 几乎所有的版本控制系统都以某种形式支持分支. 使用分支意味着你可以把你的工作从开发主线上分离开来,以免影响开发主线. 在很多版本控制系 ...

  4. GIT分支管理模型

    GIT分支管理模型 link: git-branching-model 主分支(Main branches) 项目两个常驻分支: master 主干分支(锁定),仅用于发布新版本,平时不能在上面干活, ...

  5. Git详解之三 Git分支

    相关文档 — 更多 Git 基础培训.ppt GIT 使用经验.ppt GIT 介绍.pptx GIT 分支管理是一门艺术.docx Eclipse上GIT插件EGIT使用手册.docx git/gi ...

  6. Git 分支-利用分支进行开发的工作流程

    3.4 Git 分支 - 利用分支进行开发的工作流程 利用分支进行开发的工作流程 现在我们已经学会了新建分支和合并分支,可以(或应该)用它来做点什么呢?在本节,我们会介绍一些利用分支进行开发的工作流程 ...

  7. git学习笔记之二 -- git分支

    前面对git基础作了简单的总结,这次对git的杀手锏--分支做一总结. Git分支简介 几乎每个版本控制系统都以某种形式支持分支,可以使你的工作从开发主线上分离开来,以免影响开发主线.很多版本控制系统 ...

  8. Git分支使用心得

    在去年的大约这个时候,我的领导让我研究一下git的使用方法,方便我们自己的代码管理,因为我们原先使用的是SVN,使用起来没那么方便,所以让我研究研究git的使用.我就简单的研究了两天,用我的IDE(v ...

  9. Git详解之三:Git分支

    Git 分支 几乎每一种版本控制系统都以某种形式支持分支.使用分支意味着你可以从开发主线上分离开来,然后在不影响主线的同时继续工作.在很多版本控制系统中,这是个昂贵的过程,常常需要创建一个源代码目录的 ...

随机推荐

  1. 小程序wxss编译错误

    控制台输入openVendor() ,清除里面的wcsc.exe,然后重启工具.

  2. UVA12163 游戏

    题目大意 现在有两个人在一个n个结点的有向图上玩一个双人游戏,保证图中无环和自圈.游戏的规则如下:1.初始的时候$i$号点有一个正权值$value_i$2.两名玩家依次操作,每个玩家在当前回合可以选择 ...

  3. 1030 Travel Plan (30)(30 分)

    A traveler's map gives the distances between cities along the highways, together with the cost of ea ...

  4. [BZOJ1396&2865]识别子串

    bzoj1396 bzoj2865 dbzoj1396 dbzoj2865 题面 XX在进行字符串研究的时候,遇到了一个十分棘手的问题. 在这个问题中,给定一个字符串\(S\),与一个整数\(K\), ...

  5. wpf staticresource 是不允许向前引用(forward reference)的

    不允许向前引用(forward reference)在C/C++中中很常见,即在语法上,未定义变量.类之前,不能使用. 没想到wpf中的wpf staticresource也遵循这种规则.资源字典中, ...

  6. C# 播放音乐

    用 .NET 自带的类库 System.Media 下面的 SoundPlayer 来播放音乐的方式,此种方式使用托管代码,应该是更为可取的方式吧 使用起来非常简单,下面稍作说明: . 支持同步.异步 ...

  7. ParentViewController中添加SubViewController(IOS学习)

    我是用的是Container.addSubView的方法. 1. ParentViewController.m的@interface()中添加2个子vc的实例变量,代码如下 @property (no ...

  8. python的语法糖

    # -*- coding: utf-8 -*-def deco(func): print("before myfunc() called.") func() print(" ...

  9. R语言最好的IDE——RStudio

    转自http://www.dataguru.cn/article-1602-1.html 看到很多的R语言教材,介绍的编辑器或者IDE都是很简陋的那些,就没有见到有人提到RStudio.对于不使用Em ...

  10. 使用CocoaLumberjack时,自定义的log文件名

    CocoaLumberjack是一个功能丰富的第三方日志系统.其生成的log文件,默认是自动命名的,如果需要自定义文件名,重载两个函数即可. // Log.h#import "CocoaLu ...