Vitali Plagov
Vitali Plagov

Reputation: 762

Make a "fork" of a depot repo in perforce

In perforce I have a repository in depot. I want to make a copy of this repo under tasks or streams. Speaking with git terminology - to make a fork. How can I make it? I have a write-access to a repo in depot.

Since I might confuse perforce terms, I will show with screenshot examples: Under depot I have several folders like this:

enter image description here

I want to copy one of the folders under depot and paste it under streams as shown on here:

enter image description here

Upvotes: 0

Views: 893

Answers (2)

P West2395
P West2395

Reputation: 1

I just create a new depot in the GUI and then add a new stream (again from GUI) make it a top level stream and then it asks if you want to branch an existing stream across. Select the depot/stream you need to fork and then it will copy that into your new stream.

Upvotes: 0

Samwise
Samwise

Reputation: 71517

I'll give two different answers, neither of which uses the word "repo" or "fork" since those aren't terms in Perforce and they could mean two different things ("repo" could be a "depot" or a "server" -- the confusion is compounded by the fact that people sometimes say "depot" to mean "server" if their server only has one depot):

To branch a path //depot/thing from your classic depot depot into a new stream on the same server:

  1. Create a new stream depot: p4 depot -t stream streams
  2. Create a new stream: p4 stream //streams/thing
  3. Populate the stream from //depot: p4 populate //depot/thing/... //streams/thing/...

To clone that path from your shared server into a mainline stream on a new personal server:

  1. p4 clone -f //depot/thing/...

(The p4 clone command automatically creates a stream depot, a mainline stream, and a client workspace on your personal server that will be created in the current working directory -- you should run this someplace outside of the client workspace that you use on the shared server.)

Upvotes: 2

Related Questions