bars icon
magnifying-glass icon

Pull request previews

Pull request previews allow you to test your code on the internet without setting up a new service. Simply create a pull request in your repository and Hostman will automatically deploy it and provide you with a link to test the results.

To turn on PR previews, click Pull request preview in the menu at left and switch on the toggle at the top.

enter image description here

Now it's time to create a pull request. If you don't know how, follow the instructions for Bitbucket and GitHub below.

When the pull request is created, you'll see the deploy of the commit you requested to pull.

enter image description here

Click on Open deploy log if you want to see the preview build progress. When the deploy is finished, you'll see a link with a temporary domain name to test your code. You'll also receive an email containing this link.

enter image description here

All settings such as environment variables, build command, and directory will be inherited from the service settings, so if you need to change any of them, you can do so in Settings in the menu at left.

When you merge this pull request or decline it, the preview will be automatically destroyed. If you don't want to generate previews for your pull requests, switch off previews at the top of the page.

Pull request on Bitbucket

To create a pull request on Bitbucket, start by creating a new branch in your code:

git branch new_branch_name

Make changes in your code and commit them:

git commit -a

Then push new code to your repository:

git push origin new_branch_name

You'll get something like this:

Total 0 (delta 0), reused 0 (delta 0)
remote: Create pull request for new_branch_name:
 * [new branch]      new_branch_name -> new_branch_name

Copy this link and paste it into your browser, and you'll see something like this:

enter image description here

All you have left to do is to click Create pull request. That's it! Return to the pull request previews in your Dashboard and you'll see the deploy of this pull request.