Git: auto pull from repository?

Git has “hooks”, actions that can be executed after other actions. What you seem to be looking for is “post-receive hook”. In the github admin, you can set up a post-receive url that will be hit (with a payload containing data about what was just pushed) everytime somebody pushes to your repo.

For what it’s worth, I don’t think auto-pull is a good idea — what if something wrong was pushed to your branch ? I’d use a tool like capistrano (or an equivalent) for such things.

Leave a Comment