Garrett Albright
Garrett Albright

Reputation: 2841

Changing branches in Perforce

The client has asked me to submit changes into a different, pre-existing branch in their Perforce repo, but I'm having a tough time figuring out the process for that.

What's the Perforce equivalent of git checkout other-branch? Search engines are failing me; possibly because I'm using Git terminology and/or concepts that don't actually exist in p4.

Once I have the other branch "checked out" or whatever the correct p4 terminology is, can I just create and submit my changesets in the normal way?

Are there any caveats to doing this in the CLI versus p4v? I've mostly been using the latter because I'm a n00b.

Upvotes: 3

Views: 511

Answers (2)

gareth_bowles
gareth_bowles

Reputation: 21130

Branch specs in Perforce are just different paths. If you have something like

//depot/product/main/...

in your p4 client spec, you'd change it to

//depot/product/branch/...

to get the branch, and use p4 sync to get the files and p4 add/edit/delete/submit as per usual to make changes. You'd merge changes between branches using p4 integrate.

See the Perforce docs for more info.

Upvotes: 1

crownjewel82
crownjewel82

Reputation: 437

p4 workspace is the command you want. If you're using p4v you can just add that branch to a new workspace.

You may also find this handy dandy comparison chart useful. http://www.perforce.com/sites/default/files/command-comparison.pdf

Or this cheat sheet: https://jira.atlassian.com/secure/attachment/91198/cheat_sheet.pdf

Upvotes: 0

Related Questions