use svn in xcode 4.5

6 篇文章 0 订阅

1. http://blog.csdn.net/totogogo/article/details/7871388 server side安装subversion edge

2. create a repository "testproject" with standard trunk/branches/tags structure  in svn, let's say the repository url is http://XXX.XXX/svn/testproject 

3. in Xcode, open organizer window, select "Repositories", and then click "+" in the left button corner, select "add repository.."

4. set name as "testproject", set location as "http://XXX.XXX/svn/testproject", set type as "subversion", click next. Input svn username and password.

5. confirm "Trunk" field value is "trunk", "Branches" field value is "branches" and "Tags" field value is "tags", click "add" button. 


这时organizer window的左边list会添加一个"testproject" repository with standard folder structure. 假设我们现在要把an existing iOS project "MobileApp1"添加到该repository.


6. select "Trunk" node under repository node, click "Import" button, and then select "MobileApp1" folder, click "Import" button. input commit message, and then click "Import" button.


这时你已经把MobileApp1 commit to svn repository "trunk" folder


7. Quit Xcode! and then delete existing MobileApp1 project, because it is not linked to svn. We must checkout the project from svn repository with following steps.


8. In organizer window, select "Trunk" node under "testproject" repository, and then select "MobileApp1" folder, click "Checkout" button. 然后选择用来存放该project的path, click "Checkout" button. a window popup to ask you if open the project, click "Open" button to open this project. select menu "file > source control > refresh status" to check svn status


这时就会把MobileApp1 checkout到local,你会看到在testproject repository node下多了一个folder "MobileApp1"


9. select this "MobileApp1" node, double click the .xcodeprj to open project


这时你就可以在xcode里进行开发,修改了的file会有"M"标志,添加的file会有"A"标志。当你要commit to svn时


10. select menu "File > Source control > commit".   (如何不行,则重启Xcode,如果还不行,就open organizer window, select the "MobileApp1" folder node mentioned in step 9, and then click "Commit" button)


当你想download the latest svn时


11. select menu "File > Source control > update". (如何不行,则重启Xcode,如果还不行,就open organizer window, select the "MobileApp1" folder node mentioned in step 9, and then click "Update" button)


这时svn里的file和local的有冲突,就会出现标志。会出现一个window列出所有修改,添加的file list,但那个"update" button是灰化的,在file list里right click任何一个file,select "check all",奇怪,update button enable了,click it! done!


有时对于 出现"M"标志的files,需要select menu "File > source control > discard change…"来update!




如果你想revert to old version in svn, sorry,Xcode不提供这个feature。Xcode can commit, switch branches, branch/merge, diff previous versions, update to HEAD, but you can't revert.



ref link: http://stackoverflow.com/questions/5417687/where-is-the-revert-option-in-xcode-4s-source-control



如果其他developer要从svn加载project,则可以重复上述的steps,除了step 1, 2 and 7!


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值