北京SEO

git 推送至svn使用步骤详解

2019/10/10/17:45:21  阅读:2223  来源:谷歌SEO算法  标签: SEO教程

svn是同步版本控制工具而git是一款免费、开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项了,下面我们就一起来git 推送至svn使用方法,希望下文能够帮助到大家.

一,配置svn 保存明文密码

这样,使用git推的时候,就不会每次询问密码了.

  1. WithrecentversionsofSubversion(~1.8)youcanconfigurepasswordcachingvia$HOME/.subversion/servers:
  2. [global]
  3. store-passwords=yes
  4. store-plaintext-passwords=yes
  5. Butdependingonyoursystemthismaybenotenough.Ifitisnot,makesurethat$HOME/.subversion/configcontains:
  6. [auth]
  7. password-stores=
  8. Whichmeansthatthevariablepassword-storesisexplicitlysettotheemptystring(backgroundisthatsvnnowcontainssupportforsomekey-agenttools-andtheinterfacingtothedefaultconfiguredonesmaybefragile-resultinginsilentignoringoftheaboveoptionsandnon-cachingbehaviour).--phpfensi.com
  9. Whenusingsvnforthefirsttime,thehierachy$HOME/.subversioniscreatedafterthefirstsvnoperation-e.g.whendoingthefirstcheckout.Subversioncreatesthenthementionedfilesandfillsthemwiththemostimportantoptions-commentedout,includingsomedocumentation.
  10. Thus,italsomakessensetomoveanold$HOME/.subversiondirectoryawaytohaveawell-definedstartingpoint.
  11. Anotherpitfallarepermissions-i.e.fileswhicharenotreadableunder$HOME/.subversion-butthisshouldnotoftenbetheproblem,becausewhensvncreatesthem,ittakescareoftherightpermissions(e.g.theauthdirectoryisonlyreadablebytheuserthen,notbythegroup/all,independentoftheconfiguredumask).

看了下,修改过配置后,保存的密码是明文的,如:

  1. ┌─[sh4d0walker@HuangYe]-[~/.subversion/auth/svn.simple]-[WedJul09,02:46]
  2. └─[$]<>cat1902b28055f9b44a3128bef8bfcaf4fc
  3. K8
  4. passtype
  5. V6
  6. simple
  7. K8
  8. password
  9. V8
  10. pw123456
  11. K15
  12. svn:realmstring
  13. V31
  14. <svn://172.16.7.253:81>prj2014
  15. K8
  16. username
  17. V6
  18. abcdef
  19. END

可以看到,这里有仓库地址,用户名(abcdef)和明文密码(pw123456),K 和 V后面那个数字表示的是值的字符长度.

二,git 开始拉取svn仓库中的代码

git svn clone -s svn://172.16.7.253:81/prj2014/myprj/

注意最后面的/ 一定不能忘记了,不然没法clone. svn 就是这样,忍受下吧.

The -s is there to signify that my Subversion repository has a standard layout (trunk/, branches/, and tags/.) If your repository doesn’t have a standard layout, you can leave that off.

-s 参数表示使用的是svn标准命名方法,即 trunk,tags,branches,这个参数有时很重要,建议使用,命 令后面还可以加个文件夹名字作为clone后的目录

git svn fetch

可能碰到只想从某个版本开始进行fetch,那么请需要 –r 参数,例如:

$ git svn fetch -r 1342:HEAD

本地修改代码后提交,这个跟没用svn时一样,不提.同步远程svn 服务器:git svn rebase 我个人的理解就是,这里相当于svn里的svn up 命令.

  1. BeforecommittingbacktoSubversion,youwillwanttoupdatetoapplyanynewchangesintherepositorytoyourlocalGitrepo.
  2. ThiswilldownloadallnewchangesetsfromSubversion,applythemtothelastcheckoutfromSubversion,andthenre-applyyourlocalchangesontopofthat.

推送到远程svn服务器:

When you’re ready to commit back to Subversion, execute:

git svn dcommit

日常修改和提交,与git的工作流程完全一样,为了方便合并,减少不必要的麻烦,最好保持主分支master不变,在一个新的分支进行日常工作.

切回master从SVN获取最新代码:

  1. $gitcheckoutmaster
  2. $gitsvnrebase

master同步后,与工作分支合并.

  1. $gitcheckoutwork
  2. $gitrebasemaster##手工解决可能的冲突

最后说下,git-svn初始化,这个应该用得少.

git svn init SVNREMOTEURL.

广告内容

git 推送至svn使用步骤详解 git 推送至svn使用步骤详解 git 推送至svn使用步骤详解

相关阅读

热门评论

小浪SEO博客 小浪SEO博客

专注SEO优化思维、SEO技术的实战分享类博客~

总篇数183

精选文章

RMAN中catalog和nocatalog区别介绍 小技巧:为Linux下的文件分配多个权限 zimbra8.5.1安装第三方签名ssl证书的步骤 解决mysql不能远程连接数据库方法 windows服务器mysql增量备份批处理数据库 mysql中slow query log慢日志查询分析 JavaScript跨域问题总结 Linux下负载均衡软件LVS配置(VS/DR)教程 mysql中权限参数说明 MYSQL(错误1053)无法正常启动

SEO最新算法