Committing Project to Git

Hi guys, i was following the great info from here but have hit a bit of a snag. After getting it to work in the script playground, for some reason the same script doesn’t complete the action.

What is strange, the add script works but the commit does not. I had to alter slightly from the link above, i am testing on a windows machine so the git.exe path is specified. This script is located in the Project Update -
projects_directory = ‘C:\Program Files\Inductive Automation\Ignition\data\projects’
gitExe = ‘C:\Program Files\Git\Bin\git.exe’

commit_command = ‘{ge} -C {pd} commit -m {msg}’.split(’ ')
commit_command[0] = gitExe
commit_command[2] = projects_directory
commit_command[5] = “testing”
subprocess.call(commit_command)

Any output in the wrapper log from the “git add” or “git commit” commands?

The fact that you got the add working implies you got all your paths right, and commit should be very simple after that… I’m not sure what might be going on.

Another thought: could your issue be related to file access permissions? I had to make sure to always access git as the same user that the Ignition service runs under. If you try to modify the repository while logged in as someone else, it may fail because that user can’t access the files under .git or possibly change ownership of those files and prevent the original user from accessing them later.