WordPress svn syntax to add a plugin to the wordpress directory

Wordpress svn syntax to add a plugin to the wordpress directory

Getting Started


# Create a local directory on your machine to house
# a copy of the repository.

$ mkdir my-local-dir

# Check out the repository

$ svn co http://plugins.svn.wordpress.org/your-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.

$ 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.

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.

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!


Updating


# 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
# ... 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
> 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!


Recursively add extra files


svn add * -–force