Using gitsync to Update pfSense® Software Between Snapshots

Most often upgrading to a new development snapshot is the best way to get updated code when tracking a development version of pfSense® software (alpha, beta, RC, etc).

However, since new snapshots are only built once per day in most cases, one can often get by with pulling new code from the pfSense CE Git repository instead of reloading a whole new snapshot. This is useful for testing code changes committed since the last snapshot. This process is known as a gitsync.

Warning

This process is not compatible with pfSense Plus software.

Warning

A gitsync only synchronizes PHP changes without any binary changes. At times, PHP changes require associated binary changes that only come from an upgrade using a snapshot or other upgrade image.

Unless development is followed closely and the ramifications of all changes are understood, or unless breakage is not a concern, do not use this!

For most users, this action should only be taken if directed to do so by a developer.

This only works with code or files that are not compiled. For example: PHP Code, configuration files, GUI pages, etc.

There are two ways to perform a gitsync, both perform the same function:

Method 1:

From the console menu, press option 12 to start a developer shell, then type:

> playback gitsync master
Method 2:

From a normal shell (console menu option 8), type the following command:

# pfSsh.php playback gitsync master

Warning

This must be run from an actual shell prompt over SSH or at the console. Do not attempt to run this through the GUI.

The master part of the command tells the gitsync process to grab the code for the master branch, a.k.a. HEAD, main, etc. That can be replaced with a version-specific branch such as RELENG_x_y_z.

For example, on 2.6.0, to sync post-release code changes for 2.6.0, use:

# pfSsh.php playback gitsync RELENG_2_6_0

Troubleshooting

The gitsync script attempts to install git automatically. However, if an error occurs the git package may need to be added manually. This can be done from a shell prompt:

# pkg install git

Git Protocol changed/URL Moved

Occasionally something on GitHub changes and renders an old clone of the repository broken. The most recent change was a change to disable certain protocols in favor of only using HTTPS. In this case it’s necessary to delete the old clone so that gitsync can create a fresh copy.

# rm -rf /root/pfsense/
# pfSsh.php playback gitsync master