CinCout
CinCout

Reputation: 9619

Merging changes from one branch to another

My colleague has changed a bunch of files in a specific branch (let's call it b1). He has shared with me the changelist ID.

I want to copy all those changes to another branch (b2) which is locally copied to my machine as well.

How can I achieve the same using Perforce?

Upvotes: 0

Views: 14574

Answers (2)

Samwise
Samwise

Reputation: 71562

Type this into a command prompt:

p4 integrate b1/...@CHANGE,CHANGE b2/...
p4 resolve
p4 submit

where CHANGE is the changelist number, and b1/... and b2/... are the paths to the two branches.

Source: https://www.perforce.com/perforce/doc.current/manuals/cmdref/

Upvotes: 3

tkosinski
tkosinski

Reputation: 1696

  1. make sure both b1 and b2 are defined in your workspace
  2. Right-click on the changelist from the Submitted Changelists view and select "Merge/Integrate using Selected Changelist nnnn"
  3. From the Merge/Integrate view, if you don't already have a defined Branch Map (that's recommended if you will be doing this often), choose "Specify source and target files" and choose b1 as your source and b2 as your target.
  4. Fill out the rest as you prefer and resolve (if necessary)

Details Merging Files Between Codelines

Upvotes: 1

Related Questions