Best approach for git and openhab config

Thanks, i tried the thing with the readmes and issues… i kind of like my new pro setup :smiley: for sure my installation could be handled otherwise, too, but i think i can use it at home for my different projects as well…

1 Like

one small question is left for now:

if you are at home and edit within vscode on your samba share - How can you use the builtin git plugin to commit changes?

i tried that as well, but my samba user was not able to change things in the .git folder… Damn permissions, I should go deeper into this, this approach would be really cool…

edit:
On the openhab server i add “sudo -u openhab” before the git promts, as @rlkoshak does. But i think i need to allow the samba user to edit the .git folder as well, that should work out.

It really depends on how you’ve mounted the samba share and how is configured the share point in samba on the openhab server.

I personnaly don’t use the git’s vscode plugin. I always use the command line. So under my windows laptop, I ssh and sudo -u openhab for every git command. On my linux workstation, I don’t have the problem, I can either use the VS Code plugin or the command line.

But I’ve noticed on my laptop that the VS Code plugin detects a lot of changes, whereas there is none… This is probably a permission or a git configuration issue. I didn’t investigate yet…

that’s what i also saw… There are changes shown in some icon files which definitely are not there…

Okay, then i understood how you guys work with it and i’m nearly there. Thanks again.

For me I usually have a terminal open to the OH server open anyway, often in the terminal window in VSCode, so I’ve not used the VSCode git integration that much.

But it seems to me that if you shared the folder using openhab as the share user that should work.

I was tired of always typing sudo -u openhab before every git command.
So I just added the following alias in the .bashrc of the pi user: alias git='sudo -u openhab git'

My Raspberry Pi is only used for Openhab, there is no impact on anything else.

If I need to bypass the alias, I just have to escape it with a backslash: \git <command>

See you next time :wink:

that’s a freakin’ easy and good idea… i’ll copy that :smiley: