Skip to navigation

Fork elements in Postman

View as Markdown

A fork is a new instance of an element. When you change a fork, its parent element remains unchanged. In Postman, you can fork collections, environments, and specifications. Forking enables you to contribute to an element without having Editor access for that element.

Create a fork

When you fork an element, you create a copy of it in a different workspace. You must sign in to Postman to create a fork. To fork an element within a public workspace, you must make your profile public.

To fork a collection, do the following:

  1. Select the collection in the sidebar.
  2. Click Use in the upper right of the workbench. Or, hover over the collection in the sidebar, select Options icon View more actions, and then select Use / Fork.
  3. Select a workspace to save your fork to.
  4. Under Use as, make sure Fork is selected. Fork is selected by default.
  5. Enter a label for your fork.
  6. (Optional) Select environments to fork with the collection. Postman pins these environments to your fork.
  7. (Optional) For collections that contain only HTTP requests, select Pull changes from the source collection automatically to keep your fork up to date with the parent collection.
  8. (Optional) Clear Watch the source collection if you don’t want to be notified when the parent collection changes. If you chose to pull changes automatically, this option is Watch the forked collection and notifies you when your fork changes.
  9. Click Use Collection. Postman creates your fork in the selected workspace.

If you’re on a Postman Enterprise plan, you fork collections the same way you fork environments and specifications. Click Fork instead of Use, or select Fork instead of Use / Fork in the sidebar. Then click Fork Collection.

To fork an environment or specification, do the following:

  1. Select the environment or specification in the sidebar.
  2. Hover over the element in the sidebar, select Options icon View more actions, and then select Fork. Or, for an environment, click Fork icon Fork in the upper right.
  3. Enter a label for your fork, and select a workspace to save it to.
  4. Click Fork Environment or Fork Specification. Postman creates your fork in the selected workspace.

If there are any mocks or monitors associated with the parent element, they aren’t linked to the forked element. You must create mocks and monitors specifically for the fork if you need them.

Add a collection as a dependency

The Dependency option is only available in local mode. To use it, you must use the Postman desktop app and connect the workspace to your local Git repo.

In the Postman desktop app, when you click Use on a collection, you can add the collection to a workspace as a dependency instead of forking it. You can’t edit a collection that you add as a dependency. You can only update it or delete it.

To add a collection as a dependency, do the following:

  1. In the Postman desktop app, select the collection in the sidebar.
  2. Click Use in the upper right of the workbench. Or, hover over the collection in the sidebar, click Options icon View more actions, and then select Use / Fork.
  3. Select the workspace to add the collection to. If the workspace isn’t connected to a Git repo, click Connect Git to connect it. You can’t add a collection as a dependency to the workspace it’s already in.
  4. Under Use as, select Dependency.
  5. Click Use Collection. Postman adds the collection to the workspace as a dependency.

To get the latest changes from the source collection, hover over the dependency in the workspace’s sidebar, select Options icon View more actions, and then select Update. To remove the dependency, select Delete instead.

Edit a fork’s label

To change a forked collection or environment’s label, do the following:

  1. Select the forked collection or environment in the sidebar.
  2. In the workbench, click the fork’s label and edit it.
  3. Click anywhere outside the label to save your changes.

View fork information

When you hover over a forked element’s label in the sidebar, you can view information about the fork. Information includes the source of the fork, who created it, and when the fork was created. Click the name of the source element to open it. To share a forked collection or specification with collaborators, click Link icon Copy URL.

For collections and environments, you can also view details about forks and the users who have created them. This enables you to identify the users who are actively consuming and contributing to your APIs.

To view all the forks for collections or environments, do the following:

  1. Select the forked collection or environment in the sidebar.
  2. In the right sidebar, click Fork icon Forks. For collections on plans other than Postman Enterprise, you can also click the number next to Use in the upper right of the workbench. This lists the collection’s forks and the workspaces that use it as a dependency. For environments and collections on Postman Enterprise plans, click the number next to the fork icon Fork icon in the upper right of the workbench.

Pull updates from a parent element

You can pull updates from a parent element into a fork without going through the pull request process. Forked collections that contain at least one non-HTTP request don’t support pulling updates, merging changes, or resolving conflicts.

  1. In the sidebar, select Options icon View more actions > Pull changes next to the forked element.
  2. Review the diff and click Pull Changes in the upper right of the workbench.

To pull updates from a parent collection or environment during the pull request process, see Pulling updates during a pull request.

Specifications use fast-forward merging and replace changes in the fork with changes from the parent element when you pull updates.

Merge changes from a fork

If you have Editor access on the element, you can merge a fork into the parent element without going through the pull request process. For example, if you’re using forks to organize the work in your workspace, you can merge changes in a fork directly back into the parent element. If you’re collaborating with others, merging directly lacks the safeguards built into the pull request process. Many teams require pull requests as part of their version control workflow.

To merge changes from a fork, do the following:

  1. In the sidebar, select Options icon View more actions > Merge changes next to the forked element.

  2. Review the diff and click Merge All Changes.

  3. Select one of the following merge options:

    • Merge changes — Merge the changes into the parent element. This doesn’t make any changes to the fork. You must have Editor access to the parent element.
    • Merge changes and update source — Merge the changes into the parent element. Any differences in the parent element are also made to the fork. You must have Editor access to both the parent and forked elements.
    • Merge changes and delete source — Merge the changes into the parent element. After the merge process is complete, Postman deletes the fork. You must have Editor access to both the parent and forked elements.
  4. Click Merge.

To merge changes during the pull request process, see Merge changes from a pull request.

Resolve conflicts from a fork

A merge conflict happens when you try to merge changes into an updated parent element and Postman isn’t able to automatically resolve the differences between the two. If there’s a conflict when you try to merge a fork, you’ll need to decide how you want to resolve it before continuing.

Merge conflicts can involve changes in more than one workspace.

To resolve a merge conflict from a fork, do the following:

  1. In the sidebar, select Options icon View more actions > Merge changes next to the forked element.

  2. Next to a merge conflict, click Pull the changes to pull the updates from the parent element into your fork.

  3. Choose the changes you want to include when you merge:

    • Click Keep Source to keep the change on your fork. You can also click Keep all changes to source to keep all changes on your fork.
    • Click Keep Destination to keep the change on the parent element. You can also click Keep all changes to destination to keep all changes on the parent element.
  4. Click Pull Changes to pull updates from the parent element into your fork.