0

I have a git project on my Mac. And i push my changes via ssh to a git-server ("Server B") (github or gitbucket or own should be irrelevant here).

And then there is the hosted webserver ("Server A") which shows the state of developement to the customers. From time to time i login to my webserver via ssh and type git pull to update the project before i tell the customer that there is a new version.

Is there a way to automate that? Is it possible to set something up, that always send the files to "Server A" with some kind of copy command after i do a git push on my local computer?

DerZyklop
  • 3,672
  • 2
  • 19
  • 27
  • "github or gitbucket or own should be irrelevant here", actually, it's not irrelevant. GitHub and BitBucket both offer services that can help to automate this kind of thing. – ChrisGPT was on strike Sep 08 '14 at 14:43

1 Answers1

0

You can setup a git hook, post-commit, on your local computer to ssh and pull on the Server A each time you commit something.

There is no client side hook for pushing but if you don't want a hook to run each time you commit, you could simply alias a command like git push && bash update_SERVER_A.sh.

Apparently a pre-push hook is being added in 1.8.2, so even better ;)

Community
  • 1
  • 1
Emil Davtyan
  • 13,808
  • 5
  • 44
  • 66