How can I get the git repo on my server to automatically sync with changes to the github repo?

StackOverflow https://stackoverflow.com/questions/18725363

  •  28-06-2022
  •  | 
  •  

Question

I have a github repo which I've cloned onto an ubuntu server and I can push, pull and commit no problem. I was wondering if there's an easy way to have it that when updates are pushed to the github repo my server repo will be notified and pull the changes, since as of right now I have to log in to the server and pull manually.

I know I could set up a git repo on my server and push directly to it, but my team and I would much rather use github for issue tracking and other github related features.

Any help would be much appreciated.

Was it helpful?

Solution

First get your git to login automatically without a password. See this helpful article on github https://help.github.com/articles/why-is-git-always-asking-for-my-password

Next, add a cronjob as described here Git auto-pull using cronjob

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top