ios developer tiny share-20160721

本文介绍了如何使用Xcode的SourceControl功能进行代码版本管理,包括创建本地仓库、检出远程项目、查看修改状态及文件版本对比等基本操作。

今天分享下Xcode的Source Control,和其它IDE一样,Xcode也包含一个代码版本控制的工具,包括代码版本控制的基本操作,如checkout、update、commit、show log等。

The first time you save a project created from a template, you have the option of enabling source control. If you don’t have a GIT or Subversion server setup, select “Create Git repository on” and choose My Mac from the pop-up menu. Otherwise, choose Add To New Server, and in the following sheets, provide the server information.


To checkout an existing project in a repository, choose Source Control > Check Out, and provide the server information in the following sheets. Choose a server from the table or enter a server address in the text field below. Click Next, enter your credentials, and click Next again. Choose a location for your working copy and click Download. If successful, the Source Control menu items are enabled.
To see the files you modified in the navigator, click the project navigator () and click the source control status icon in the filter bar. The project navigator shows only the files that have a source control status such as modified (M). You can use this filter bar to view the set of files you are actively modifying.
To see the changes you made to a file, select the file in the project navigator, choose the version editor () in the toolbar, and choose an option from the pop-up menu. To compare file versions, choose Comparison. To find out who last changed each line of code in your file, choose Blame. To view the source control log for the file, choose Log.


If you choose Comparison, the editor compares the local revision with the last revision committed to source control. For each change, Xcode shows the line that changed and highlights the changes to the line. To compare the local revision to an older revision, choose the older revision from the jump bar on the right. To compare any two revisions, select them from the jump bars on the left and the right.
To save the changes you made to files, choose Source Control > Commit. In the sheet that appears, optionally review the changes and exclude or discard specific changes. Then enter a commit log message, optionally select “Push to remote”, and click the Commit button.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值