0

I have a folder on my desktop which is git cloned to a certain branch. Now I want to do a Automatic Git pull whenever something is pushed to that branch (Assuming there are no conflicts). How do I achieve this ? I am a novice in GIT. So looking for some detailed solution.

Nabin
  • 13
  • 4
  • The simplest solution would be to simply issue a `git pull` every so often, often enough that you get the updated files within reasonable time, but not so often that the remote host that holds your repository refuses your calls. If the remote repository is also local then that shouldn't be a problem then. – Lasse V. Karlsen Aug 14 '17 at 16:18

2 Answers2

0

Automatic Git push is not something already there in with GIT. Plus they won't even suggest that because You might be working on something or in middle of something. SO auto pull may cause issues.

If you still want that Then there are basically 2 ways:

  1. Set up a CRON in your system and simply add git pull to it.
  2. Another would be that, github provides webHooks, so you can setup a local web server on your machine and trigger git pull on that trigger on webhook
Akarsh Satija
  • 1,756
  • 2
  • 22
  • 28
-1

I don't think there is a simple way to do it if you are total novices to git... I may suggest you to read this book and try this to make you more confortable with the syntax and the process.