[翻译] USING GIT IN XCODE [5] 在XCODE中使用GIT[5]
USING GIT IN XCODE

USING BRANCHES
Branches can be a very effective tool to isolate new features or experiments in code. Xcode has pretty good support for branches, but it is not shown in the project view. The first method you can use to commit code to a branch is to select “Commit to Branch…” instead of “Commit X Files” from the commit view.
分支控制是一个非常有用的隔离新特性的一种开发方式。Xcode对于分支支持得很好,但是没在视图中显示出来。你可以在 “Commit to Branch…”中选择向那个分支提交,而不是在“Commit X Files”上提交。

Xcode will ask you to select a branch to commit to, or will allow you to create a new branch.
Xcode会问你要向哪一个分支上提交代码,抑或你自己再创建一个分支出来。

Once you have committed to a branch from master, you will be automatically switched to that branch. You can continue making changes and commits to the branch. So how do you know what branch you are on in Xcode, or get back to the master branch, or switch to another branch? Visit the Repositories in the Organizer, find the repository for your project, and select the working copy.
一旦你从主分支向子分支提交了代码,你将会自动切换到子分支当中去。你可以继续进行修改提交到这个子分支中。所以,你怎么知道你是在Xcode中的哪一个分支呢?你可以通过访问Organizer中的Repositories,在那里你可以发现你的分支。

To see what branch you are currently on, look in the upper right hand corner of the Repository view.
为了查看当前是在哪一个分支上,查看右上角的view。

To switch back to master or to another branch, click the “Switch Branch” button in the lower right hand corner. Select another branch, and your Xcode project workspace will be updated to reflect the current contents of the other branch.
为了切换到主分支或者是其他分支中去,点击右下角的按钮“Switch Branch”。选择另外一个分支,然后,你的Xcode project workspace会自动的切换到另外一个分支中的内容。
When you are ready to merge a branch, switch to the branch you want to merge into first from the Organizer. Then switch back to the project view, and select File | Source Control | Merger from the Xcode menu. Xcode will ask which branch you would like to merge into your current branch.
当你准备比较两个分支的代码时,先在Organizer中切换到你要比对的分支当中去。然后回到工程中,选择File | Source Control | Merger from the Xcode menu,Xcode会询问你要与哪一个分支比较代码。

Xcode will then present a merge view, which will allow you to review each difference between the current branch and merge branch.
Xcode之后会显示出一个比较的view,允许你检查两个分支的不同之处。

Use the sliders to selectively include or exclude changes from the branch in the merge.
If there is a conflict in the merge, the merge view will highlight the conflict in the merge view with red and a question mark in the center.
使用sliders来选择或者取消修改过的代码。
如果存在着冲突,比较代码的工具会高亮冲突的代码,然后在中间的地方用红色的带有疑问的标记显示着。

The merge view will offer four choices for resolving the conflict: keep both changes, placing the left before right, keep only the left changes, keep only the right changes, and keep both changes, placing the right before left. In addition the code can be directly edited in the merge view.
比较代码的工具会提供4种选择解决冲突:保持两个改变,使用左边的变化,使用右边的变化,另外,你可以直接在merge上修改代码。
[翻译] USING GIT IN XCODE [5] 在XCODE中使用GIT[5]的更多相关文章
- git篇之二----团体项目中使用git
上篇说了git的简单入门,本篇来说一下在团体项目中我们该如何简单使用git 一般来说,当我们进入公司之后,就前端项目而言,若是有多个同事共同开发一个系统,我们可能会每个人去负责各自的模块. 若是人员较 ...
- [.net 面向对象程序设计进阶] (27) 团队开发利器(六)分布式版本控制系统Git——在Visual Studio 2015中使用Git
[.net 面向对象程序设计进阶] (26) 团队开发利器(六)分布式版本控制系统Git——在Visual Studio 2015中使用Git 本篇导读: 接上两篇,继续Git之旅 分布式版本控制系统 ...
- (转载)在Visual Studio 2015中使用Git
原文:http://blog.csdn.net/damon316/article/details/51885802 1. VS2015在对Git的支持 VS2015是微软IDE集成开发环境的重量级升级 ...
- Git权威指南学习笔记(二)Git暂存区
例如以下图所看到的: 左側为工作区,是我们的工作文件夹. 右側为版本号库,当中: index标记的是暂存区(stage),所处文件夹为.git/index,记录了文件的状态和变更信息. master标 ...
- 如何在cmd中集成git
1.要在cmd中集成git,要解决在cmd中输入git命令时不提示git不是内部或外部命令: 即需要将git添加到path变量中,即将D:\Git\mingw64\bin和D:\Git\mingw64 ...
- 不懂Git,别说自己是程序猿–20分钟git快速上手(转)
在Git如日中天的今天,不懂git都不好意思跟人说自己是程序猿.你是不是早就跃跃欲试了,只是苦于没有借口(契机). 好吧,机会就在今天. 给我20分钟,是的,只要20分钟, 让你快速用上git. 我们 ...
- [翻译] USING GIT IN XCODE [3] 在XCODE中使用GIT[3]
USING GIT IN XCODE MAKING AND COMMITTING CHANGES Once you have a working copy of your project, it’s ...
- [翻译] USING GIT IN XCODE [1] 在XCODE中使用GIT[1]
USING GIT IN XCODE http://www.cimgf.com/2013/12/10/using-git-in-xcode/ Git has become a very popular ...
- 在Xcode中使用Git进行源码版本控制
http://www.cocoachina.com/ios/20140524/8536.html 资讯 论坛 代码 工具 招聘 CVP 外快 博客new 登录| 注册 iOS开发 Swift Ap ...
随机推荐
- MySQL 报错MySQL server syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT'
在hive的应用中,出现如下错误时You have an error in your SQL syntax; check the manual that corresponds to your MyS ...
- leetcode 98,判断二叉树为BST
方法一,记录子树的上界和下界,root的左子树一定小于root的值,root的右子树一定大于root的值,然后递归左子树和右子树 public class Solution { public bool ...
- Nginx配置日志格式记录cookie
Nginx配置日志格式记录cookie1. 一般用来做UV统计,或者获取用户token等. 配置方式: 在nginx的配置文件中有个变量:$http_cookie来获取cookie的信息.配置方式很 ...
- 反应器(Reactor)模式
Java NIO非堵塞技术实际是采取反应器模式,或者说是观察者(observer)模式为我们监察I/O端口,如果有内容进来,会自动通知我们,这样,我们就不必开启多个线程死等,从外界看,实现了流畅的I/ ...
- python实现float/double的0x转化
1. 问题引出 最近遇到了一个小问题,即: 读取文本文件的内容,然后将文件中出现的数字(包括double, int, float等)转化为16进制0x存储 原本以为非常简单的内容,然后就着手去写了py ...
- Linux信号机制代码示例
1 基本功能: 本Blog创建了两个进程(父子进程): 父进程: 执行文本复制操作,当收到 SIGUSR1信号后,打印出现在文件复制的进度: 子进程: 每个固定时间段向父进程发送一个 SIGUSR1 ...
- Python__函数和代码复用
主要内容 函数的定义和使用 实例:七段数码管的绘制 代码复用与函数递归 PyInstall库的使用 实例:科赫雪花小包裹 函数的定义与使用 函数的理解与定义 函数的使用及调用过程 函数的参数传递 函数 ...
- ios app真正的相互!!调用
1.需求:A应用打开B.B回跳到A 2.问题: 看到网络上的文档讲的大多数都是app单向跳转的例子,而我们在跳转到第二个app的时候往往需要返回到原来的app,虽然支付宝微信等第三方等应用会有回调 ...
- execl中设置的格式无法实现
在一次项目中,需要导出execl表,并且要给表中的表格设置格式,因为每列的格式都不一样,需要单独设置设置这些格式,在后期使用中因为导入的数据过多,是的后面的单元格中设置的格式无法实现. 每次打开exe ...
- HDU 1695 GCD 欧拉函数+容斥定理 || 莫比乌斯反演
GCD Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...