I modified the bash script from the best practices guide which has a guide to configuring automatic Git commits on Designer save. I made it so that it adds the author of the change and the timestamp of the change to the commits, and I wanted each resource to be its own commit so it does that too.
The commit is saved under the author as well.
Edit #1: Modified commit comment to use the file saved instead.
Original guide: Ignition 8 Deployment Best Practices | Inductive Automation
#!/bin/bash # this script requires that json library `jq` is installed # add any new files created to git file tracking git add . originalUserName=`git config --list | grep 'user\.name=[\w]*' | sed -e 's/user.name=//g'` NOW=`date +"%Y-%m-%d %H:%M:%S"` # find the tracked files that have differences, taking only get their 'resources.json' file git diff --name-only HEAD | grep -E 'resource.json$' | \ # ... and loop through each file. Note: what is returned is the relative file path each changed file. # This need to be appended onto the working directory held in var $PWD while read relFilePath do # create a variable with the full path of the changed resouce.json file filePath="$PWD/$relFilePath" folderPath=`echo "$filePath" | sed 's/\/resource.json//g'` fileName=`basename "$folderPath"` relFilePath_fmt=`echo "$relFilePath" | sed 's/com.inductiveautomation.//g' | sed 's/\/resource.json//g'` # extract out the author of the change and the time using the json library `jq` author=`jq -r .attributes.lastModification.actor "$filePath"` tstamp=`jq -r .attributes.lastModification.timestamp "$filePath"` # format the date nicely to put in the commit comment tstamp_fmt=`date --date="$tstamp" +"%Y-%m-%d %H:%M:%S"` git config --global user.name $author git commit -m "Modified '$relFilePath_fmt' @ $tstamp_fmt by $author" --date $tstamp -- "$folderPath" done git config --global user.name "Unknown" # commit everything else that doesn't have a resource.json git commit -m "Modified resources without resource.json @ $NOW (commit time) - Author could be $author but this is not known" # push the changes to Git git push origin master # set the username back to the original user git config --global user.name "$originalUserName"