Deploying BitBucket Repos with Github for Windows to WebFaction
Github for Windows for BitBucket
=
- Download Github for Windows
- Clone a BitBucket repo anywhere on your system
- Drag that repo into Github for Windows (now you can use Github for Windows to commit/sync to BitBucket)
BitBucket Deployment to WebFaction
=
- Download WinSCP
- Login to your WF account via SFTP
- Open Putty from WinSCP toolbar (icon with 2 computers and a lightning bolt)
-
Navigate to your hidden .ssh folder (this is where all your .ssh key stuff goes)
cd ~/.ssh
-
Generate ssh key pair of the rsa type (that's what the -t flag is)
ssh-keygen -t rsa
-
Copy your public key
cat id_rsa.pub
Paste your public key to Account Settings > SSH Keys in BitBucket
Pulling Changes from BitBucket
=
- Clone your BitBucket repo to a folder in your site (add a . at the end of the clone command to clone the contents of the repo). Use SSH clone so it stores the password
-
Inside of pull.php
<? `git pull`;
Now go to BitBucket > foo_project Repo > Settings > Services and add a POST Service Hook that polls fooproject.com/pull.php
Update your local repo, push with Github for Windows, and look at fooproject.com for the changes
Thanks Dejan! https://twitter.com/dekomote
Written by Cory Simmons
Related protips
1 Response
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/39654/3c70b2bfe768f636c2661ef462f50ba7.jpeg)
Dont' you feel this is rather unsafe? Any POST request to fooproject.com/pull.php will launch a pull. I'm asking because I want to know and simply feel a bit reluctant to use this like that.
Have a fresh tip? Share with Coderwall community!
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/47212/cory-simmons-700.png)
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/13764/92c604dd5773c613f9e94aa83cdbbb06.jpeg)