zoukankan      html  css  js  c++  java
  • 代码管理:SVN的使用

    SVN是一种代码托管的工具,它虽然没有GIT那么先进,但是历史悠久,目前很多代码备份和托管依然使用了SVN的方式,因为所在机构的服务器上就有SVN,所以需要学习一下。这里讲的操作主要是针对Linux,Windows下有个比较傻瓜的小软件,tortoise SVN,用起来很简单,就不赘言了。

    使用前需要知道所在机构的SVN服务器的网址:

    1. 常见命令
    • add
      svn add file.type
      This command will add the local file into svn version control, then you can use svn commit to upload it to svn server.

    • blame (praise, annotate, ann)

    • cat

    • changelist (cl)

    • checkout (co)
      svn checkout path(http path of the linux server) (name change)% checkout(download) files from svn server
      notice: all the files will be downloaded to your current directory, so make sure to use cd to change the current directory to your desired place

    • cleanup

    • commit (ci)
      % update local file change to svn server
      svn commit filechagne.typ -m 'comment'
      The condition to do svn commit is that you have checkout the file in local directory form svn server.

    • copy (cp)

    • delete (del, remove, rm)
      % this command will delete a single file or a whole directory in svn server
      svn remove -m 'comments' http://svn.directory/.../file.type % which will remove a single file
      svn remove -m 'comments' http://svn.directory/.../directory/ % which will remove this directory

    • diff (di)

    • export

    • help (?, h)*
      svn --help % show the svn help, it will list many help command.

    • import
      % this command will upload new file to the svn server
      svn import -m 'comment' file.type http://svn.directory/.../file.type % this will add the file in svn server, be careful about the last file name, do not misspell it, or your file will have a wrong name.
      svn import -m "comments" . http://serverpath/currentdirectory% this command will upload the current directory to svn(containing all files)

    *info

    *list (ls)

    *lock

    *log

    *merge

    *mergeinfo

    *mkdir
    % this command will make a new directory in the svn server.
    svn mkdir -m 'comments' http://svn.directory/.../newdirectory

    *move (mv, rename, ren)

    *propdel (pdel, pd)

    *propedit (pedit, pe)

    *propget (pget, pg)

    *proplist (plist, pl)

    *propset (pset, ps)

    *resolve

    *resolved

    *revert

    *status (stat, st)

    *switch (sw)

    *unlock

    *update (up)
    svn update %The command will update the change to local file(s) from the svn server. Which is to say the file on the server remains the same while local file is changed.
    svn update % this command will update all the file and related directory from server to the local directory,
    % which is to say the files on the server are not changed and only the local file is changed.

    [http://wiki.greenstone.org/wiki/index.php/Useful_SVN_Commands reference: Greenstonewiki_svn_commmands]

  • 相关阅读:
    线程基础知识归纳
    并发编程情况下几个相应问题简介
    Spring Security的RBAC数据模型嵌入
    Mysql插入中文的字段内容时乱码的解决方法
    部分排序算法总结
    sendEmail 阿里云使用587端口
    linux服务器关闭ipv6 方法
    centos 6.8 安装git 报错
    强大的xargs
    nfs环境搭建报错clnt_create: RPC: Program not registered
  • 原文地址:https://www.cnblogs.com/docnan/p/7410144.html
Copyright © 2011-2022 走看看