[翻译] 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 time to get to work.  As you make changes to the project, Xcode will indicate when files have been changed from the working copy.

当你成功的将项目复制到了本地,现在就可以干活了。当你更改了项目中的某些文件的时候,Xcode会直接指示出文件的修改情况。

An “M” next to a file indicates it has been modified, and an “A” indicates the file is new to the repository.

To commit changes, select File | Source Control | Commit from the Xcode menu.  Xcode will display all the differences from the working copy in the commit view.  If you only want to commit some of the changes, you can check or uncheck files as desired to include or exclude them from the commit.  In addition, you can select only the files you want to commit before selecting File | Source Control | Commit from the Xcode menu, and only the files you have selected will be displayed in the commit view.

“M”标记这这个文件被修改了,“A”标记着新添加了一个文件到项目当中了。为了提交更改,打开File | Source Control | Commit from the Xcode menu。Xcode将会显示出更改的内容。如果你只想提交某些更改,你可以只提交某些修改过的文件。

 

In this example, I have added a label to the storyboard with a corresponding property in the view controller, and have added a new class to the project.  I only want to commit the label changes, so I have selected those and added a commit message in the bottom section.  In addition to making file level selections for a commit, Xcode can do line level selections for a commit.

在这个例子中,我给storyboard添加了一个属性并在对应文件中进行了一些修改。我只想提交这一个修改。所以我只选择了那个要提交的文件,剩下的Xcode会帮你处理好的。

In this example, I have work in progress in myExperimentalMethod, but I have added the desired functionality to myNewMethod and would like to commit so other members of the team can use it while I finish myExperimentalMethod.  By clicking on the numbers in the center column I can select whether a change should be included in or excluded from the commit, or I can discard the change.

Note that Xcode will not show deleted files that have been removed from the project.  When a file is deleted from an Xcode project, the project will indicate that the project has been modified, but the file will no longer be visible in the Xcode project view.  The deleted file will be staged for the next commit and will be included in the next commit, but it will not be visible in the project view or the commit view.

在这个例子中,我正在修改myExperimentalMethod,我修改了一些代码后想提交给其他的人来使用,我可以只提交某些部分的修改给其他人使用。

注意,Xcode会显示已经从项目中移除了的文件。当一个文件从Xcode中被删除了,Xcode会标示出修改的信息,但是这个文件在项目中并不可见,这个被删除的文件会在下一次提交中显示出来,而不会在这次提交中显示出来。

 

目录
相关文章
|
开发工具 iOS开发 git
mac安装git后,在终端里运行git命令,系统提示需要安装Xcode问题解决
直接下载git for mac 安装包,https://git-scm.com/download/mac 安装完后,git的默认安装目录是:/usr/local/git 但是使用 which git 命令后,发现git的目录是:/usr/bin/git 意思是我们安装的git-xxx.dmg默认路径在/usr/local/git,但Mac系统执行git命令却去/usr/bin/git下找。
3063 0
|
开发工具 git iOS开发
Mac 下为 XCode 创建 Git 服务器 - 简单得不能再简单
Mac 下为 XCode 创建 Git 服务器 - 简单得不能再简单 太阳火神的美丽人生 (http://blog.csdn.net/opengl_es) 本文遵循“署名-非商业用途-保持一致”创作公用协议 转载请保留此句:太阳火神的美丽人生 -  本博客专注于 敏捷开发及移动和物联设备研究:iOS、Android、Html5、Arduino、pcDuino,否则,出自本博客的文章拒绝转载或再转载,谢谢合作。
1052 0
|
开发工具 iOS开发 git
Using GIT In Xcode
Using GIT In Xcode Post by Joe Keeley on December 10, 2013 Git has become a very popular version control system in iOS and Mac development.
1237 0
|
开发工具 iOS开发 git
iOS开发那些事-Git在Xcode中的配置与使用
<p>很多Git命令都是在命令行下运行的,命令行下管理Git有很多优点不用多说。但最大的缺点是要求用户记住这些命令。因此Git图形界面还是很受一些用户欢迎的,其中Xcode作为集成开发环境工具,也提供了一定Git图形界面功能。但是要想在Xcode中使用Git管理工程代码还想需要进行一些配置,然后才能使用。</p> <p>如果我们是使用Xcode 4创建的一个iOS工程,在终端的命令行中提交代码
1528 0
|
开发工具 iOS开发 git
iOS开发那些事-Git在Xcode中的配置与使用常见问题总结
<p>书接上回提出的Git在Xcode中的配置与使用常见问题4个问题</p> <p><span id="more-255"></span></p> <p>问题1,如何在Xcode中创建代码库,并添加和提交代码到代码库?</p> <p>问题2,如何在Xcode中提交推送给远程服务器代码库?</p> <p>问题3,如何在Xcode中克隆远程服务器代码库到本地?</p> <p>问题4,如何使用Xco
1861 0

相关实验场景

更多