Do you use versioning (GIT) for the config?

I normally like to use some version control to keep changes tracked. Do you use GIT or SVN for versioning the changes you do in the UI?

Thanks!

Would definitely recommend to version your config with git. If you use the UI to configure openHAB then you are most interested in the jsondbs in the userdata folder.

The following is an excerpt from my gitignore file, meaning I don’t add the following to my repo with exception of the files marked with „!“

userdata/*
!userdata/secrets
!userdata/etc
!userdata/jsondb
userdata/jsondb/backup
userdata/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json
!userdata/config
!userdata/habot
!userdata/openhabcloud
!userdata/uuid
!userdata/zigbee
!userdata/zwave
userdata/backup

I use git mainly because the rest of the world has moved away from svn. If you’re going to contribute to an open source project, it’s almost certainly going to be hosted on GitHub so for consistency sake I use git for my private stuff too (but I run an instance of GitLab at home, I don’t use GitHub for that stuff).

Here’s my .gitigore to see which folders you should include/exclude from userdata.

userdata/*
!userdata/secrets
!userdata/etc
!userdata/jsondb
!userdata/config
!userdata/habot
!userdata/openhabcloud
!userdata/uuid
!userdata/zigbee
!userdata/zwave
userdata/jsondb/backup
userdata/backup
.Trash-1000
conf/html/hum.jpg
conf/html/light.jpg
conf/html/power.jpg
conf/html/temp.jpg
conf/automation/lib/javascript/personal/node_modules
conf/automation/js/node_modules/*
!conf/automation/js/node_modules/rlk_personal
*py.class
*.swp
*~
*.old
conf/automation/js/rlk_personal.tar

I run in Docker so my userdata and conf folders are in the same root home folder. If you have an installed OH, you’ll need to either use symlinks to achieve the same or put conf and useradata into separate repos.

You’ll notice it’s almost identical to @fex’s.

Question for @fex , why exclude DiscoverResult? Have you had issues with it in the past? It does make some sense to exclude it, unless you’ve marked some things to be ignored. If you have ignored some inbox Things, you’ll lose that if your delete DiscoverResult, right?

I can see arguments either way for whether to include the userdata/persistence folder or not. If you are using git as a sort of backup system, you’ll want to include that folder. However, it’ll be binary data so every commit will include a big binary change to probably all of the files in that folder and git doesn’t handle that sort of thing gracefully. A different backup strategy would be advised for that (of course if you are using an external persistence service like Influxdb or PostgreSQL you’d manage that separately anyway).

I don’t want versioned files changing without any manual change from my side, git status should really only show differences if I changed something intentionally. As I also never use DiscoveryResult to configure new Things, preferring to manually add new stuff, it made no sense to version DiscoveryResult :sweat_smile: