< All Topics
Print

Versions & Branches

Versions

Git Updater reads the Version headers from both the local file and the remote file. For an update to show as available the remote version number must be greater than the local version number. It is required to have a Version header in your main plugin file or your theme’s style.css file. It is better to use Semantic Versioning.

Primary Branch

By default, Git Updater will pull from the HEAD of the master branch. It will use these file versions for comparison purposes. However, you can also tell Git Updater to use tags or alternate branches instead of the default for updating. master but can be changed using the Primary Branch header.

As an example, Primary Branch: main if you’ve created a new, recent GitHub repository and the new default branch ins main.

Tagging

This applies to the primary branch only. By default this is master but can be changed using the Primary Branch header.

Git Updater recognizes tagged releases. If tags are present, Git Updater uses the most current tagged release as the download link for updates.

It is important that the Version header in your main plugin file or your theme’s style.css file match the tag name in a tagged release. What happens when your plugin/theme shows an update, the update will come from the current tag. If you don’t consistently tag your releases, once you start, the download may not be as current as master. The results may not be what you expect and a circle of updating may ensue.

When testing I find it simpler to decrease the version number in the local file rather than continually push updates with version number increments or new tags.

Branch Support

By default, Git Updater uses the master, or designated Primary Branch branch, and tagged releases take priority over HEAD. However, you can change this behavior to test other branches.

Branch Switching via WordPress Admin

In the Git Updater Settings there is a setting to enable branch switching for plugins and themes. When checked there will be a new ability from the Plugins and Themes pages to switch between branches.

The branch switching option is displayed on the page where plugin/theme activation, deactivation, and/or deletion options are displayed.

Switching to the current branch will reinstall the current branch.

Git Updater gets it current branch information from one of two methods, a branch switch or an install.

Git Updater will use the specified branch for updates and version checks. Git Updater ignores tags unless the source branch is master. For example, branch develop will always use the HEAD of develop. Tags will be ignored even if they are present because the branch is not master.

The default state is master.

Table of Contents