Q: Automatically update local Git repository I want to clone a GitHub repository that's not mine, and keep this local cloned repository always up to date, that is, whenever a new commit is made upstream, my local repository is also updated automatically.
My use case is CI/CD, I need to clone repositories several times in my jobs, if I had a local GitHub cache it'd be way faster.
Is this possible?

A: One simple solution is to use a cron job to update the git repository. If you're running Linux or MacOS, from the terminal run:
crontab -e

This will take you to a CLI text editor. Add the following entry:
*/5 * * * * cd <full path to your local git repository> && git pull

Every 5 minutes (change 5 to something else if you want more frequent updates) this will pull the latest from the remote repository.
There might be a more efficient way to do this but anything simple will require polling since a GitHub repository that's not yours won't be able to push notify upon change. Cron is fairly lightweight anyway.
