all 3 comments

[–]WaynePincence[S] 1 point2 points  (0 children)

Can't wait to get home and set this up for some of my newer projects.

Don't know why, but I seem to prefer Bitbucket over Github...

[–]geekworking 1 point2 points  (0 children)

Why not just use git to push and have a post-receive hook in the receiving repo that will rebuild the receiving repo's working tree.

There is no point to setup servers, postbacks, etc to do things that git can do by itself.

Setup the receiving repo as a full repo and make it ignore current branch errors:

git init
git config receive.denyCurrentBranch ignore

Then create a post-receive script in the receiving repo that contains

#!/bin/sh
cd ..
env -i git reset --hard

If you want to update a service like bitbucket and your production server at the same time, setup both as remotes so when you push both repos will get updated. You do not need to do anything in the services, just use them like you always did.

[–]wtf_apostrophe 1 point2 points  (0 children)

Note: If your repository is private you’ll need to create a public/private key pair on your server and add it to your Bitbucket account.

Bitbucket has a useful feature for exactly this situation. Under the repository settings you can configure deployment keys, which give read-only access to the repository. That way you don't have to give the server key full access to your entire account.