Automatic pull from a git repo

This seems to be a really hard thing to search for, but I’m looking for a tool or setup to automatically pull some simple website content ( a module in a larger web app ) from git whenever a commit is made to the repo. Seems like a simple thing to do, and I get that I could do this via cron but I thought there’s a universal way with git hooks etc.

There’s also a git module that I found, but when installed on latest vm it broke apache, so I quickly removed it.

I know this is not really a webmin/vm thing, but I’d like to either integrate or manage it from within vm if possible.

Thanks,
Nick

SYSTEM INFORMATION
OS type and version Ubuntu 24
Virtualmin version Latest

Hello,

Do you control the Git repository, or are you pulling changes from a third-party repository to which you only have read access?

It’s my own private repo, so yes I would be writing the code that gets pulled. I’m just wanting to save the steps of ssh, switch account, cd to dir, git pull, exit, exit - that I have to do every time. Preferably with an ui - multiple small repos in the same project for different parts of the app - it would be good to know what state they were in by looking at it, and then being able to back track etc too.

Thanks,
Nick

Why not do all that in a cron job as the the requuired user ? So you could have something like
cd <dir> && git pull as the cron job command this saves any ssh logins any privlidge concerns and of course no need to exit as cron opens and closes the shell

It’s pretty simple to implement webhooks, it’s just a little PHP (or whatever you like) script that checks a secret (so random people can’t trigger updates) and pulls your latest tagged version or a branch.

I’ll look into adding something to do that in Virtualmin, though.

None of the existing Git-related plugins for Virtualmin or Webmin are at all related to what you’re trying to do, and are mostly unmaintained. Not recommended.