Thanks, i tried the thing with the readmes and issues… i kind of like my new pro setup for sure my installation could be handled otherwise, too, but i think i can use it at home for my different projects as well…
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
that’s a freakin’ easy and good idea… i’ll copy that
Thx for your insights, that was were helpful to me!
Could someone please share a .gitignore
file so that I don’t have to put unnecessary stuff under version control?
Thx and have a great weekend
I have a Docker install so the paths are a little unique but you should be able to figure it out.
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
I exclude everything in userdata and then explicitly list the folders I want to save. I have to add back in the backup folders though. You might have additional folders from add-ons. You also might want to include persistence.
In conf I exclude installed node_modules except for my personal module and some image files that used to get populated from a rule.
Thx @rlkoshak, I appreciate that