Perforce Bridge

What is the Perforce Bridge?

The Perforce Bridge lets you synchronize your Perforce repository to your WVS Project repository in real time so you can continue using Perforce and still take advantage of the automation features of WVS.

The Bridge is bi-directional so you can push from P4 to WVS or from WVS to P4, however, we suggest starting as a push from P4 exclusively up front until your organization has familiarity with both source control management systems.

Setup

Prerequisite

  • Python 3
  • Git and LFS
  • SSH Key

If you don’t already have everything on the list of prerequisites, here is a quick guide on getting set up.

note
Read our Docs to get detailed instructions on how to generate and add SSH Keys and work with external git.
  • Create, or if you already have one in your home directory, update the .gitconfig in your user directory.
  1. Based on the project you have (Unity or Unreal), you’ll want to grab the .gitconfig file that is works with your project.
  2. In your OS-specific user directory on your computer, create a file and name it .gitconfig.

    • Example file location on Windows: “C:\Users<user>"
  3. You can start by right-clicking in the explore window and creating a new text file.
  4. Right-click on the file you just created and rename the file, including the extension to .gitconfig.
  5. Open the .gitconfig file in an editor of your choice.
  6. From step 1, copy the content and paste it into the file in your home directory and save the file.
  • In the .gitconfig file you just created, locate the [git-p4] section and update the following information:

    • user : perforce user name
    • password : perforce password
    • port : perforce server information ( ex: ip_address:port )
    • host : perforce host in your workspace view ( ex: DESKTOP-I6BLBNA )
    • client : perforce workspace name

Create a local git clone

We will need to clone the Perforce repository into a local git project on your machine that you will use to maintain the bridge.

  1. Create a directory on your machine that you would like to use.
  2. In the command prompt or terminal, cd into the new directory.
  3. Copy your depot path and run the following command to create the clone:
   git p4 clone <//depot/path/project>@all


note
You can omit the @all if you do not wish to clone the full history. more options and info can be found here: https://git-scm.com/docs/git-p4.

Pushing To WVS

You now have a git repository that is set to track your Perforce workspace. In order to sync your changes into WVS, you’ll have to create a repo in WVS and push your project

  1. Create a Project in WVS. Select the project based on the type of project you have. (Unreal or Unity).

  1. Enter the name you would like to use for your project, select a namespace, and create project.

  1. Go to your project homepage and copy the sshUrl from the clone dropdown.

note
If you have a really large project and/or poor upload speeds or connection speeds, you may want to use an https url for the remote instead.
  1. Go back to your command prompt on your machine and cd into the directory of your local git clone.
  2. To get everything set up and ready to push to your WVS repo, run the following command to add an origin remote:

sshUrl:

        git remote add origin git@wvs.io:your/repo_url.git

https:

        git remote add origin <https://wvs.io/your/repo_url.git>
  1. Next, push the repo and set the upstream to be tracked by running the following command:
        git push --set-upstream origin master
note
With the upstream specified, every other push after that can just be:
        git push

Get Started

Head back to the WVS Bridge Page to get started.

Troubleshooting

For additional support, please reach out to us on our Discord.

Was this helpful?

We would love to hear your feedback, Submit a ticket in our Issue Tracker.


Report a problem with this page.