1

I have a repo on my server and can connect to it locally. My repo is located at:

public_html/example/repo

While my public folder is located at

public_html/example/public

Lets say I create an index.html "Hello World" file on my local, push it to my repo. I'd like to be able to see it right away in the web browser (so in the public folder). I know I can clone the repo into public and pull it in to see the changes, but I'd rather skip that extra step.

My question: Is it possible to view the latest and greatest version in a specific folder (public) every time someone pushes to the repository instead of having to pull in the files every time? If yes, what's the best way? Thanks in advanced. I would love to be able to just refresh my web browser to see the updates.

jasonsemko
  • 743
  • 1
  • 7
  • 17

1 Answers1

1

You can create a post-receive hook in the repository that automatically refreshes the contents of your public folder.

More information about writing hooks can be found on the githooks(5) man page.

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
  • I see what you're saying and this looks like a great solution, I just don't understand through reading how to select a particular folder and force it to pull, do you have a tutorial you recommend for this? Thanks! – jasonsemko Apr 23 '11 at 03:44
  • Never mind I'm understanding, it's just a matter of me learning to write a shell script – jasonsemko Apr 23 '11 at 04:02