Error: Your local changes to the following files would be overwritten by merge

Hello,

I am trying to update my LibreNMS (1 of many) and I get this issue. I have made changes that I want to keep. What commands do I need to follow to allow my LibreNMS to update?

Thanks

git pull

Updating f9a379fa3..9635f88c0

error: Your local changes to the following files would be overwritten by merge:

includes/polling/functions.inc.php

Please commit your changes or stash them before you merge.

Aborting

Hello @gonzo
Best way is to contribute your changes to the project. Or upgrade will be broken by your manual change.
You can manually “combine” your changes and the librenms upgrade, but doing so every few days (if Master) or every month (if stable) will soon be annoying…

How do I manually combine just to allow me to do this update?

Looking further down the line how do I contribute?

To combine, the simplest way (without doing git magic) is the following :

  • log as ‘librenms’ user
  • Copy your modified file(s) to another directory (like /tmp)
  • git checkout <pathOfTheFileToRestore>
  • ./daily.sh
  • Edit the newer version of the file that was modified and re-do your modifications. You have the old file you backuped as model. DO NOT simply copy your oldfile, that would most probably break whatever change was done in LibreNMS.

In order to contribute, you can start here :
https://docs.librenms.org/Developing/

GitHub is not as complicated as it may seems. It is probably a very good idea to have a dedicated “test and dev” virtual machine (can be a VirtualBox VM on your PC) so you don’t play on your production server for developpement.