SVN是一个比较方便的版本管理系统,wordpress的插件就是利用该系统进行管理的,我对svn不熟悉,所以即使wp早就通过了我的cos-html-cache的插件申请,我也是最近几天才上传上去,如果你也有类似的情况,下面的内容也许对你有帮助,因为或许你也和我一样,不需要过多的关心什么是SVN,仅仅需要能将你的插件上传到WP而且今后可以编辑,仅此而已。

———————华丽的分界线——————————–

All you want to do is add the plugin files you already

have to your new repository.

所有你想要做的就是将你写好的插件文件传到wordpress的官方插件文件夹里

To do that you’ll need to

你需要做的步骤如下:

1. Check out the blank repository.从远程文件取出空白文件夹,这样你就可以清楚的了解目录结构了

2. Add your files to the trunk/ directory of your local

copy of the repository.将本地的文件放置到trunk目录下,别放目录,直接放你插件目录下的文件

3. Check in those files back to the central repository.将本地文件同步更新到远程文件

# Create a local directory on your machine to house

在本机创建一个目录作为插件的根目录

# a copy of the repository.

下面的命令解释在括号中,请大家运行命令的时候不要带上括号的内容

$ mkdir my-local-dir (进入windows的命令行 开始-〉运行->cmd,然后进入一个盘符:e:

建立一个文件夹my-local-dir )

# Check out the repository

将服务器上的文件夹结构取出

$ svn co http://svn.wp-plugins.org/your-plugin-name

my-local-dir (your-plugin-name是你成功申请的plugin name,而my-local-dir

就是你刚才建立的文件夹,运行这个命令之后,你本地的文件夹下就有一个标准的目录结构了)

> A my-local-dir/trunk

> A my-local-dir/branches

> A my-local-dir/tags

> Checked out revision 11325.

# As you can see, subversion has added ( “A” for “add”

)

# all of the directories from the central repository

to

# your local copy.

现在服务器上的插件文件夹已经下载到本机了,下一步就是复制你的插件文件

# Copy the plugin files to the local copy.

# Put everything in the trunk/ directory for now.

将所有的插件文件复制到trunk/目录下,注意,请直接复制目录下的文件,不用在trunk/再建立一级目录,席面的两行操作如果是windows,用win界面完成即可

$ cd my-local-dir/

my-local-dir/$ cp ~/my-plugin.php trunk/my-plugin.php

my-local-dir/$ cp ~/readme.txt trunk/readme.txt

# Let subversion know you want to add those new files

# back into the central repository.

接下来将你的文件夹添加到svn,即告诉svn哪些文件是要添加到服务器的

my-local-dir/$ svn add trunk/*

> A trunk/my-plugin.php

> A trunk/readme.txt

现在就将更新的文件发送到服务器上

# Now check in the changes back to the central repository.

# Give a message to the check in.

执行下面的命令将会发送文件到wordpress的服务器,’Adding first version of

my plugin’ 引号的文字只是一个message,随便你输入什么

注意:第一次使用svn发送文件的时候会提示你输入用户和密码,这个用户和密码就是你wordpress.org的注册用户和密码

my-local-dir/$ svn ci -m ‘Adding first version of my

plugin’

> Adding trunk/my-plugin.php

> Adding trunk/readme.txt

> Transmitting file data .

> Committed revision 11326.

# All done!

至此为止,插件的上传已经成功完成

Task 2: Editing a file that is already in the repository

任务2:修改已经存在的插件

We’ll assume you’ve already got your plugin repository

filled with the needed files (Task 1). Now suppose you

need to edit

one of the files to improve the plugin.

To do that you’ll need to

1. Make sure your copy of the repository is up to date.确保你当前的文件是最新的

2. Edit the file.编辑你想编辑的文件

3. Double check your changes.再次检查哪些文件发生了改变

4. Check in your changes.同步远程文件

# cd into your local copy of the repository and

# make sure it’s up to date

下面的命令是保证你的文件是最新的

$ cd my-local-dir/ (进入本地文件夹)

my-local-dir/$ svn up (检查文件是否是最新文件)

> At revision 11326.

# Good: all up to date. If there had been changes in

the

# central repository, they would have been downloaded

and

# merged into your local copy.

# Edit the file that needs changing. I use nano.

# No need for editor wars; use whatever you like.

my-local-dir/$ nano trunk/my-plugin.php (这个是在*nix系统下用nano编辑文件,如果是window,请用其他编辑器直接编辑你需要编辑的文件)

# … edit … edit … make typo … edit

# … fix typo … edit … all done.

# You can check and see what’s different between your

# local copy and the central repository.

# First we check the status of the local copy.

my-local-dir/$ svn stat (检查本地文件和svn服务器上文件的状态,该命令会显示哪些文件做了改动)

> M trunk/my-plugin.php

# This tells us that our local trunk/my-plugin.php

# is different from the copy we downloaded from the

# central repository ( “M” for “modified” ).

# Let’s see what exactly has changed in that file,

# so we can check it over and make sure things look

right.

my-local-dir/$ svn diff (这个命令是显示文件的那些部分做了改变,可以不用执行)

> * What comes out is essentially the result of a

* standard `diff -u` between your local copy and the

* original copy you downloaded.

# Looks good. Let’s check in those changes to the

# central repository.

my-local-dir/$ svn ci -m “fancy new feature: now you

can foo *and* bar at the same time” (将改动后的文件上传到服务器)

> Sending trunk/my-plugin.php

> Transmitting file data .

> Committed revision 11327.

# All done!

修改的流程已经完成

Task 3: “Tagging” a new version

tag或者归档一个旧的文件版本,如果该版本不再更新了,请用tag归档该版本

Each time you make a formal release of your plugin,

you should tag a copy of that release’s code. This lets

your users easily

grab the latest (or an older) version, it lets you

keep track of changes more easily, and lets the WordPress.org

Plugin

Directory know what version of your plugin it should

tell people to download.

To do that you’ll need to remember to update the Stable

Tag field in trunk/readme.txt beforehand!

Then you’ll

1. Copy your code to a subdirectory in the tags/ directory.

For the sake of the WordPress.org plugin browser, the

new subdirectory should always look like a version number.

2.0.1.3 is good. Cool hotness tag is bad.

2. Check in that new subdirectory.

# You’ve just checked in the latest and greatest updates

# to your plugin, let’s tag it with a version number,

2.0.

# To do that, copy the files from your trunk/ directory

to

# a new directory in tags/.

# Make sure to use `svn cp` instead of the regular `cp`.

my-local-dir/$ svn cp trunk tags/2.0 (将当前的文件copy到tag中,该例子表示tag到2.0)

> A tags/2.0

# Now, as always, check in the changes.

my-local-dir/$ svn ci -m “tagging version 2.0″ (上传改变的东西,更新svn服务器)

> Adding tags/2.0

> Adding tags/2.0/my-plugin.php

> Adding tags/2.0/readme.txt

> Committed revision 11328.

# All done!

服务器上在哪修改my.in,wordpress plugin的SVN使用方法相关推荐

  1. 服务器上的Linux中Tomcat有时会挂掉的问题及方法

    QUESTION:服务器上的Linux中Tomcat有时会挂掉的问题及方法? 目录 QUESTION:服务器上的Linux中Tomcat有时会挂掉的问题及方法? ANSWER: 一.内存不足 二.服务 ...

  2. java ftp取远程服务器时间_在 Java 中如何获取 FTP 服务器上的文件修改时间

    使用 Apache Commons Net 进行 FTP 编程的时候,可以使用 FTPClient 类的方法来获取和设置 FTP 服务器上特定文件的修改时间: String getModificati ...

  3. ftp服务器在线编辑,ftp服务器上怎么直接修改office文档.

    我刚刚试验过可以的. 我用的是win2003+ftp,在internet信息管理器里已经有一个ftp站点,然后把里面的一个文件夹设置成可写. 我那个文件夹叫"公用网盘",我每次外出 ...

  4. apache服务器 上传文件大小,修改Nginx与Apache上传文件大小限制

    我们使用 ngnix 做 web server 的时候,Nginx 对上传文件的大小有限制. 这个时候我们要修改 Nginx 参数. sudo vim /etc/Nginx/Nginx.conf #在 ...

  5. 在一台服务器建立多个web站点的方法,在一台WEB服务器上实现建立多个Web网站站点的几种方法...

    我们知道,网络上的每一个Web站点都有一个惟一的身份标识,从而使客户机能够准确地访问.这一标识由三部分组成,即TCP端口号.IP地址和主机头名,要实现"一机多站"就需要在这三个方面 ...

  6. 如何服务器上的打印机共享文件夹,用局域网设置共享打印机的方法有哪些?

    用局域网设置共享打印机的方法有哪些? 以下分三种情况: 1.网络共享打印机 2.USB连接主机共享打印机 3.有域控进行推送打印机 网络共享打印机 我这里所说的网络共享打印机是指端口指向IP,进行共享 ...

  7. Linux服务器上无法保存修改的文件

    在Linux上所有的东西都看作文件,所以要想修改文件必须具有文件的写权限,上述问题解决方法: chmod 777 你要修改的文件 转载于:https://blog.51cto.com/tetop/35 ...

  8. mysql忘记服务器上密码怎么修改密码,MySQL忘记密码怎么办-MySQL修改密码(亲测可用)...

    前言: 最近要用到本地的MySQL,结果把密码忘记了. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using pas ...

  9. 在此iphone上尚未受信任_电脑显示服务器上的安全数据库没有此工作站信任关系的解决方法...

    图1 1.今天上班时候同事跑来说办公电脑开机进不去了,然后我过去一看是电脑跟域里的服务器断开连接了,下面我把具体解决方法发出来给大家分享下.(图1) 图2 2.先用域名管理员账号登录电脑系统里面,然后 ...

最新文章

  1. 施有朋:人工智能崛起,AI赋能医疗领域,创业者该如何选择
  2. 关于windows service不能访问网络共享盘(NetWork Drive)的解决方案
  3. NoSQL(一):NoSQL数据库、redis
  4. mybatis java8_mybatis如何使用Java8的日期LocalDate和LocalDateTime详解
  5. 《西游记》原著的一点读后感
  6. webstorm的安装
  7. google账号解除游戏绑定_成长守护平台解除实名认证 公众号解绑操作流程
  8. 计算机健康教育应用的意义,【计算机信息论文】计算机信息在心理健康教育中的实效性(共2561字)...
  9. NYOJ-寻找最大数(贪心)
  10. python深复制_Python深浅拷贝
  11. Java实现个人博客系统(附下载源码)
  12. 定时器 Corn时间表达式
  13. Java实现短信验证码(阿里云)附短信SDK demo下载
  14. linux13:(1.0k)ISO映像文件,镜像文件
  15. solidworks2021安装教程,solidworks2021安装步骤
  16. 2021金三银四Java面试突击集锦
  17. java学习php(一)基础知识
  18. VB计算汉字笔画数代码
  19. 【LeetCode】643. 子数组最大平均数 I
  20. ubuntu如何用快捷键截图

热门文章

  1. php5.3教程,php5.3.3配置教程
  2. js触发button的点击事件
  3. win10安装Unbuntu的Linux系统的虚拟机
  4. Docker实践(二)镜像
  5. mysql存储日期 jsp_JSP+MySql的时间处理
  6. C#中的WebSocket服务器
  7. 使用LINQ计算基本统计
  8. 新商标表明华为鸿蒙系统在海外或叫做“Harmony OS”
  9. 在CentOS上的Docker私有注册表
  10. odoo10参考系列--ORM API 一(记录集、环境、通用方法和创建模型)