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

KEEPING IN SYNC WITH REMOTE REPOSITORIES
As you make changes in your local working copy you will want to keep them in sync with the remote repository. Xcode offers support for pulling from and pushing to a remote repository, and for tracking remote branches.
There are two ways to pull from a remote repository. The first is from the project window. Select File | Source Control | Pull from the Xcode menu when viewing a project window. If there are no uncommitted changes in the working copy, Xcode will present a dialog to select which remote and branch to pull from. (Note that a pull can be completed using command line Git when changes are present, but Xcode will not pull with uncommitted changes in the working directory.)
也许你想在本地备份上修改代码的时候,同步到服务器端当中。Xcode提供了pulling一级pushing操作,以及追踪远程版本。
有两种方式来从服务器端pull代码。第一种方式就是直接在工程的window菜单中操作。选择File | Source Control | Pull from the Xcode menu,如果本地没有进行修改的操作,Xcode将会提供一个菜单供你选择从哪一个分支上pull代码。

Alternatively, the Pull button from the Organizer Repositories view can be used when a working copy is selected.
另外一种方法是,这个Pull的按钮可以从Organizer Repositories中点选。

If a conflict is detected on the pull, Xcode will present the merge viewer to resolve the conflict. Just like resolving a conflict between branches, the merge viewer can be used to select which change(s) should be kept and in what order they should be if both are desired. If you do not want to resolve the conflict, click the Cancel button in the merge view and the pull will not take place.
如果在pull过程中检测到了冲突,Xcode会显示出merge工具来帮你解决冲突。如果不想解决冲突,点击取消按钮也行。

If the conflict is resolved, the working copy will be modified and will need to be committed and pushed.
To push changes to the remote repository, select File | Source Control | Push from the Xcode menu when viewing a project window.
如果冲突被解决了,你又写了代码并想提交代码。
你可以通过File | Source Control | Push from the Xcode menu来提交代码。

A branch can also be pushed to the remote repository. Xcode will detect if the branch does not yet exist in the remote, and will indicate if the branch will be created by a push.
当然你也可以提交代码到一个新的分支中去,Xcode会检测有没有你想要的那个分支,如果没有,他会帮你创建那个分支。

Once a branch has been created on the remote repository, other working copies can track that branch. To track a branch, visit Organizer, Repositories, and select Remotes for the project repository. Expand the remote name to see the available branches. (In my testing, I was not able to get Xcode to refresh remote branches without restarting Xcode).
一旦一个分支在服务器上被创建了,其他的版本都能够跟踪那个分支。要跟踪一个分支,访问Organizer,Repositories,选择Remotes for the project repository,然后选择展开的那个分支的名字。

Select a remote branch and click the Track Branch button at the bottom of the view. This will pull down the branch from the remote repository to the local repository, will allow you to switch to the branch in Xcode, and will allow pulls and pushes to take place from it.
选择了那个分支后点击Track Branch按钮,你就会从服务器更新到那个分支的代码,你可以随意的在不同的分支中切换来切换去。
SUMMARY
As we have seen here, Xcode has very usable support for common Git tasks, including setting up Git for a new project, cloning an existing project, handling modifications and commits, viewing history, using branches, and pushing and pulling from remote repositories. Xcode does not have direct support for stashing, tags, or more advanced topics like rebasing or submodules. However, all of the items that Xcode does not support can be performed using the command line tools or using a third party tool. In my day to day work with a distributed development team, I am frequently able to perform all of my Git tasks in Xcode, and only rarely need to resort to the command line. Take a second look at Xcode’s Git support if you have not done so before, and give feedback to the Xcode team so they can keep enhancing and improving Git support in Xcode.
在这里,我们可以看出,Xcode支持Git很到位,包括创建一个Git项目、拷贝一个Git项目,操作修改,提交代码,浏览历史记录,使用版本分支以及从服务器进行push或者pull操作。Xcode并没有直接支持诸如隐藏、标记、或者一些更高级更热门的功能。然而,那些更高级的功能都能够通过命令行工具或者是第三方工具来实现。在我日复一日的分布式团队工作当中,我频繁的使用者Xcode自带的git工具,只有极少数情况会用到命令行。如果您没用过Xcode自带的git工具,你可以试验一把,并给Xcode团队反馈使用上不方便的地方,帮助Xcode提升Git的使用便利性^_^。
[翻译] USING GIT IN XCODE [6] 在XCODE中使用GIT[6]的更多相关文章
- 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 [5] 在XCODE中使用GIT[5]
USING GIT IN XCODE USING BRANCHES Branches can be a very effective tool to isolate new features or e ...
- [翻译] 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 ...
随机推荐
- NLP Attention
一.概述 自动摘要可以从很多角度进行分类,例如单文档摘要/多文档摘要.单语言摘要/跨语言摘要等.从技术上说,普遍可以分为三类: i. 抽取式摘要(extractive),直接从原文中抽取一些句子组成摘 ...
- 转--log4j.properties 详解与配置步骤
一.log4j.properties 的使用详解 1.输出级别的种类 ERROR.WARN.INFO.DEBUGERROR 为严重错误 主要是程序的错误WARN 为一般警告,比如session丢失IN ...
- Ethereum 源码分析之框架
accounts 实现了一个高等级的以太坊账户管理 bmt 二进制的默克尔树的实现 build 主要是编译和构建的一些脚本和配置 cmd ...
- Node.js最新Web技术栈(2016年4月)
Node.js是比较简单的,只有你有前端js基础,那就按照我的办法来吧!一周足矣,虽然这版上了es语法,但依然是可以简单写,也可以难写,参见<全栈工程师之路-Node.js>,里面讲了No ...
- ibatis SQLmap mysql模糊查询字符串拼的三种方法
在通常情况下iBATIS的参数在sqlmap中使用#param#的形式,参数名以’#’包着,但当使用sql的LIKE语句时就发生了问题,在单引号中无法使用#param#这种形式,下面列举出了3种方法来 ...
- docker-compose管理daocker
Docker-compose管理docker服务 1.安装docker-compose @首先确保服务器上已经安装docker环境,如果没有安装使用如下命令进行安装: # yum -y insta ...
- Java的Date类与Calendar
一.Date类 在JDK1.0中,Date类是唯一的一个代表时间的类,但是由于Date类不便于实现国际化,所以从JDK1.1版本开始,推荐使用Calendar类进行时间和日期处理.这里简单介绍一下Da ...
- 关于js的 for...in 你了解多少
For...In 声明用于对数组或者对象的属性进行循环/迭代操作. 1. 求value: 对于数组 ,迭代出来的是数组元素,对于对象,迭代出来的是对象的属性值: 1)数组示例 var x var my ...
- nodejs zip压缩版安装与配置
Node.js 1.下载 下载地址:https://nodejs.org/zh-cn/download/ 选择相应的版本下载 2.解压缩 将文件解压到要安装的位置,并新建两个目录 node-globa ...
- < Python Index >
1. 基本语法 1.1 常量/变量 1.2 运算符 1.3 表达式 1.4 程序结构 2. 内置数据结构 2.1 列表 2.2 元组 2.3 集合 2.4 st ...