Android Studio: use SVN version control

First we first svn configured, you can refer to: http: //blog.csdn.net/u011429167/article/details/50392179

A: Android Studio Configuration SVN

In the Settings inside, find the Version Control-> Subversion; Use in the Control Panel of this page General election on line client WANTED TO INVITE command, and then browse the local SVN installation directory, choose to "\ svn.exe" to ;

If you do not svn.exe : Description There is an option "command line" when you did not choose to install, reinstall the next, you can check on



Second, the association Android Studio project SVN repository and add to ignore files

Android Studio add ignored files also in Settings-> Version Control (control-related settings with versions in this directory) Ignored Files under, click on the plus sign is set to ignore the file, the default Android Studio gives three Ignore way for developers to choose: ignore the specified file, ignoring all folders and files to ignore files that meet the matching rules ( Android Studio to create the Android project normally takes ignore .idea folder, .gradle folder, all of the build files folder, all files and local.properties .iml file )


After ignoring the file, we associate the project with SVN choose VCS-> Import into Version Control-> Share Project (Subversion)



之后会弹出选择要分享的SVN地址及其他选项,在Define share target下选择第二个可以再trunk下创建你当前项目的文件夹,相应的第一个选项是直接将整个文件都放到trunk文件夹下,第三个在项目文件夹下有创建了一个trunk文件夹,因此建议使用第二中方式;选择完成后点击Share就可以了




弹出让你选择SVN工作副本的格式化版本(jdk版本),建议选择1.8format,点击OK等待一会就能创建本地项目同SVN服务器的关联了;成功后会自动刷新本地的项目,待项目里的内容变成绿色的即表示已经成功了




到目前为止只是将项目同SVN服务器建立了联系,并没有将代码提交到SVN服务器上去;如何提交呢,其实很简单,只需点击SVN相关操作按钮里的commit就行了(上图SVN相关操作按钮左起第二个按钮)



点击Commit后Android Studio会先对当前代码进代码分析,如果有错误或者警告会弹出如下的框,如果有错误冲突等需要解决后再提交,如果是警告可以忽略(同Eclipse相同);第一次将整个代码提交到SVN服务器时时间有可能很长,请耐心等待,之后再创建项目时就不会这么慢了。



成功后我们就完成了新建项目同SVN的关联及导入项目到SVN服务器上了。


本文参考了知乎的一个答案:http://www.zhihu.com/question/32298079

发布了13 篇原创文章 · 获赞 4 · 访问量 1万+

Guess you like

Origin blog.csdn.net/u011429167/article/details/50392196