【背景】
本地打开了一个xcode项目:
想要上传到一个远程的svn服务器上。
【折腾过程】
1.自己去看看Source Control中看看:
看了看对应的信息:
好像应该是:
在remote界面,去添加远程需要上传的地址
2.搜:
xcode commit local to svn
xcode commit local project to svn
xcode svn commit local
参考:
iphone – importing a project into a remote SVN server in XCode 5 – Stack Overflow
Committing Files to a Repository
Configuring Xcode to use Subversion
ios – Import a project in SVN from Xcode 5 – Stack Overflow
3.算了,先随便去测试吧:
上传试试,结果出错:
结果需要输入说明:
结果出错了:
很明显:
本来此处打算去上传到一个已知的svn服务器到。
结果此处,不知道之前是怎么用了git,然后无法上传:
那就对了,否则都不知道上传到哪个服务器的。。。
4.先去:
把(之前看到的此项目中的)本地的隐藏的git目录:
想办法删掉:
然后再去重新上传到我们自己的svn服务器上去。
5.没了.git,再,双击xxx.xcodeproj,用xcode重新打开项目,果然source control中就没了那么多:
history
commit
之类的了:
但是没看到,哪里有
commit之类的选项
这样就没发,把本地已有的代码,上传到远程svn服务器上了。
6.对于
create working copy
结果是:
很明显,是git的逻辑,而不是svn的逻辑。。。
iphone – importing a project into a remote SVN server in XCode 5 – Stack Overflow
7.去试试:
先去用svn工具去checkout一个,空目录到本地:
但是此处之前是有代码的,所以要:
打开终端:
然后再去checkout所有文件,
再到命令行中,删除所有的文件:
然后commit:
1 2 | licrifandeMacBook-Pro:ios crifan$ svn commit licrifandeMacBook-Pro:ios crifan$ svn status |
才形成:一个新的,服务器端的,空的svn目录,本地也是空的
然后再把xcode代码都放进去:
然后再去双击xxx.xcodeproj打开xcode的项目:
看看里面是否可以commit进去。
8.先是可以看到了历史纪录:
9.然后还真的可以看到commit呢:
然后就上传成功了:
【总结】
Xcode 7中,想要上传本地的项目代码到远程svn服务器中,则是:
1.本地创建一个文件夹,然后svn co
得到一个本地的svn的空目录
2.然后把你要上传的代码,都拷贝到该目录中
3.然后用xcode打开项目文件,xcode中就可以去
Source Control-》Commit去上传代码到svn服务器了。
【后记】
后来,为了第二次上传更新的一个版本,再次同样的操作了一遍,
结果Xcode打开后,commit却无法commit了,显示出错了。
无法commit。
所以搞的最后实在不行,就还是去通过命令行中去commit了:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | licrifandeMacBook-Pro:ios crifan$ svn commit -m "zzz edit network related code" Sending xxxxxx /xxxxxx .xcodeproj /project .pbxproj Adding xxxxxx /xxxxxx .xcodeproj /project .xcworkspace /xcshareddata Adding xxxxxx /xxxxxx .xcodeproj /project .xcworkspace /xcshareddata/xxxxxx .xcscmblueprint Adding xxxxxx /xxxxxx .xcodeproj /project .xcworkspace /xcuserdata/crifan .xcuserdatad Adding (bin) xxxxxx /xxxxxx .xcodeproj /project .xcworkspace /xcuserdata/crifan .xcuserdatad /UserInterfaceState .xcuserstate Sending xxxxxx /xxxxxx .xcodeproj /project .xcworkspace /xcuserdata/zzz .xcuserdatad /UserInterfaceState .xcuserstate Adding xxxxxx /xxxxxx .xcodeproj /xcuserdata/crifan .xcuserdatad Adding xxxxxx /xxxxxx .xcodeproj /xcuserdata/crifan .xcuserdatad /xcschemes Adding xxxxxx /xxxxxx .xcodeproj /xcuserdata/crifan .xcuserdatad /xcschemes/xxxxxx .xcscheme Adding xxxxxx /xxxxxx .xcodeproj /xcuserdata/crifan .xcuserdatad /xcschemes/xcschememanagement .plist Sending xxxxxx /xxxxxx .xcodeproj /xcuserdata/zzz .xcuserdatad /xcdebugger/Breakpoints_v2 .xcbkptlist ... Sending xxxxxx /controller/tabcontroller/newideascontroller/ServiceViewController .swift Deleting xxxxxx /model/network/HTTPRequestSerializer .swift Deleting xxxxxx /model/network/HTTPResponseSerializer .swift Sending xxxxxx /model/network/HTTPSecurity .swift Deleting xxxxxx /model/network/HTTPStatusCode .swift Deleting xxxxxx /model/network/HTTPTask .swift Deleting xxxxxx /model/network/HTTPUpload .swift Adding xxxxxx /model/network/Operation .swift Adding xxxxxx /model/network/Request .swift Adding xxxxxx /model/network/StatusCode .swift Adding xxxxxx /model/network/Upload .swift Transmitting file data ................................ Committed revision 476. licrifandeMacBook-Pro:ios crifan$ |
然后去xcode中再去update一下后:
然后再去commit,就可以正常检测出变化了:
以后就可以继续正常的,通过xcode去update和commit了。
转载请注明:在路上 » [已解决]xcode 7中把本地代码上传到远程svn服务器上