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?

1
  • "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. Commented Sep 8, 2014 at 14:43

1 Answer 1

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 ;)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.