Git commits PUSH ONLY behavior

Product: PowerShell Universal
Version: 5.6.13

I am encountering an issue with the built-in Git integration in PowerShell Universal. Please note that I am likely not using the feature in the most optimal way, and I would appreciate any guidance or suggestions you may have.

I have configured the integration in Push-Only mode, with synchronization to a GitLab repository. This serves as an archive for all apps and helps track progress on my applications. As the sole user making changes, there are no concurrent edits from others.

The behavior I observe is as follows: despite setting the sync interval to 6 hours, every save action in the Admin Console (e.g., saving a dashboard or page) immediately triggers a local commit. These commits are then pushed to the remote repository.
Additionally, a system commit occurs every 6 hours.

This has resulted in approximately 6,000 commits in the repository, with about 70% consisting of single-line or minor changes (rarely exceeding a dozen lines).

Until recently, this was manageable. However, I have now integrated the Gitlab repository with Jira using a local LLM for analysis. The high volume of granular, low-impact commits makes it difficult for the LLM to accurately assess the actual scope and progress of work.

Interestingly, automatic commits appear to occur primarily for dashboards and pages, while modules, scripts, and APIs are only included in the periodic system commits.

In summary, a single daily aggregated commit would suffice for my needs, as the LLM can handle that level of granularity effectively.

Do you see any built-in solution or recommended workaround for this issue? For example:

  • An option to batch commits or delay them until the sync interval.
  • A toggle to disable automatic commit-on-save in Push-Only mode.
  • Any configuration adjustments to reduce commit frequency.

It sounds like you have the Git Settings Edit Mode set to Automatic.

If so, you could try to set it to Manual and write a script that performs Merge-PSUGit to push on a 6-hour schedule.

image

yep i know manual mode - but it turns the whole admin portal read only and i dont want that also

Its a mess honestly. I use manual git pushes from outside PSU

1 Like

maybe some additional info ? it might be useful…

honestly, i cant remember the details, and I dont really want to exagerate or downplay the issue. But in short local dev enviroment with VS code extension and git tracking changes on the server causes strange behaviour. For example you save a version of an app with a syntax error. The app dissapears from the PSU server and the git automatically pushes this to Git.. And in manually mode its just a lot easier to sync directly from git in terminal than a GUI imo..

i was referring to this part:
. I use manual git pushes from outside PSU

how to set it up ?

not sure how you mean? I setup a repo in our local gitlab, turn off the webservice for PSU and initialize the repo in C:\ProgramData\UniversalAutomation\Repository .
Adding locally hosted code to GitHub - GitHub Docs
Then I just push changes to files when I want. Just making sure to turn of Universal servide before to be sure everything goes smoothly. I also setup a secure hidden repo for my appsettings file.