Update Customizations with Git

When WHMCS releases an update, make certain to check whether the release included changes to your custom theme or template. If changes have occurred, you will need to apply these changes to your custom theme or template to ensure compatibility with the new release. If you customized a default theme or template by cloning one of our GitHub™ repositories, you can easily apply these changes, often without manually editing files.

Apply Changes to Customizations

To apply new changes to your customized themes and templates:

1. View the changes.

Before you begin updating your code, view the line-by-line list of changes (diff) for the applicable theme or template on GitHub.

If the release does not include any changes for the applicable theme or template, no further action is necessary.
For direct links to view each release’s diffs on GitHub, see each version’s release notes.

2. Fetch changes from the WHMCS repository.

When you are ready to apply the release’s changes, run the following command:

git fetch origin

You will see output that is similar to the following example:

remote: Counting objects: 96, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 96 (delta 67), reused 71 (delta 67), pack-reused 25
Unpacking objects: 100% (96/96), done.
From github.com/templates-twenty-one
  44d2e7c..7091cd0    master  -> origin/master
* [new tag]           v8.10.0-release.1 -> v8.10.0-release.1
* [new tag]           v8.10.0-rc.1 -> v8.10.0-rc.1
* [new tag]           v8.10.0-beta.1 -> v8.10.0-beta.1
For more information, see git-fetch.

3. Merge changes into your local repository.

To merge the fetched changes into your local template branch, run the following command:

git merge origin/master

You will see output that is similar to the following example:

 supportticketslist.tpl                             |  39 +++++++++++++++++++++++++++------------
 ticketfeedback.tpl                                 |  10 ++-
 upgradesummary.tpl                                 |   6 +-
 viewticket.tpl                                     |   4 +-
 4 files changed, 31 insertions(+), 15 deletions(-)
 create mode 100644 layout.tpl
For more information, see git-merge.

Some changes may require you to manually resolve merge conflicts before you can finish merging the code.

Merge conflicts will generate CONFLICT messages in the output:

Auto-merging includes/example.tpl
CONFLICT (content): Merge conflict in includes/example.tpl
Automatic merge failed; fix conflicts and then commit the result.
For more information, see Addressing merge conflicts.

4. Upload your changes.

Upload the changes to your template to the appropriate location for your WHMCS installation.

We recommend testing customizations before updating and applying them to your production WHMCS installation. For more information, see Set Up a Test Environment.

Last modified: October 30, 2024