Skip to content

Instantly share code, notes, and snippets.

@amirhp-com
Last active November 22, 2024 07:18
Show Gist options
  • Save amirhp-com/4d0ca2cb81aa393ed9d9db3562a7a7bd to your computer and use it in GitHub Desktop.
Save amirhp-com/4d0ca2cb81aa393ed9d9db3562a7a7bd to your computer and use it in GitHub Desktop.
How to Push a WordPress Plugin to SVN Using macOS Terminal

How to Push a WordPress Plugin to SVN Using macOS Terminal

This step-by-step guide outlines the process of uploading and tagging a WordPress plugin to the WordPress SVN repository using the macOS Terminal. By following these instructions, you'll learn how to prepare your plugin files, commit changes, and properly tag a new release. Let's dive in!


Steps to Push Your Plugin

1. Install SVN on macOS

Ensure SVN is installed on your system. Open Terminal and run:

brew install svn
svn --version

This installs SVN and verifies the installation.

2. Check Out the Plugin Repository

Download the WordPress plugin repository to your local machine. Replace my-plugin-slug with your plugin's slug:

svn co https://plugins.svn.wordpress.org/my-plugin-slug/ blackswan-plugin-source

3. Navigate to the Plugin Directory

Change into the directory where the repository was downloaded:

cd blackswan-plugin-source

4. Add All Files to the Trunk Directory

Add your plugin files to the trunk directory for the current version. Use:

svn add trunk/*

5. Commit Changes with a Message

Commit the files to the repository with a descriptive commit message:

svn ci -m 'release v2.7.0'

If SVN prompts for credentials and they fail, include your username and password directly:

svn ci -m 'release v2.7.0' --username your_username --password your_password

6. Tag the Release Version

To create a new version tag, copy the trunk directory to the appropriate version in the tags folder:

svn cp trunk tags/2.7.0

7. Commit the New Tag

Commit the tagged version with an appropriate message:

svn ci -m "tagging version 2.7.0"

Final Notes

  • Always ensure your files in the trunk directory are updated and tested before committing.
  • Tagging versions in the tags folder helps maintain a clear version history for users.
  • Use meaningful commit messages to document changes and updates.

By following these steps, you can effectively manage and deploy your WordPress plugin using SVN on macOS. Happy coding! 🎉


Resources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment