Pull request previews
  • 15 Sep 2020
  • 1 Minute To Read
  • Contributors
  • Print
  • Share
  • Dark
    Light

Pull request previews

  • Print
  • Share
  • Dark
    Light

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.

Screen Shot 2020-09-14 at 6.32.27 PM.png

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.

Screen Shot 2020-09-14 at 6.40.42 PM.png

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.

Screen Shot 2020-09-14 at 6.42.44 PM.png

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: 
remote: Create pull request for new_branch_name:
remote:   https://bitbucket.org/alexanderboykov/landing/pull-requests/new?source=new_branch_name&t=1
remote: 
To bitbucket.org:alexanderboykov/landing.git
 * [new branch]      new_branch_name -> new_branch_name

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

Screen Shot 2020-09-14 at 7.00.46 PM.png

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.

Was This Article Helpful?