Permission issues when Github for configuration backup

I use Hassbian, and followed the official HA guide to use Github as configuration backup (in a private repo). Before anyone warns me unnecessary, yes I use teir .gitignore file so no private secrets are being shared.

I found out that it’s much easier to edit and commit the files in Github and run git pull in Hassbian. However, this makes HA whine about permission issues. Anyone know how I can do this without having to switch to the homeassistant user or use sudo every time I need to do, basically anything, in Hassbian?

I switch to homeassistant user. That is is the user that is running the progrram, so that is the user that needs permissions on the files.

Thanks for your reply. I find that this probably is the best practise as well. A bit more cumbersome, but should be safer as well.