23

I am using P4v, and when i bring up the context-menu on a folder, i have these options:- - Integrate/Merge - Copy - Branch

Seems to me like they are all doing the same thing. Is there any real difference in these commands?

thanks.

lionel319
  • 880
  • 1
  • 12
  • 29

3 Answers3

19

When you integrate or merge, you blend files together. That is, you end up having to resolve files that have overlapping changes. 'p4 merge' and 'p4 integrate' do this.

When you copy, you replace files -- no overlapping changes are resolved. 'p4 copy' does this.

When you branch, you copy files to a location where no files existed before. 'p4 populate' does this.

What P4V does depends on the version of P4V you have. You can look in the log pane to see the p4 commands it's running. (Use 'Preview' to get it to run those commands with -n.)

user1054341
  • 2,781
  • 19
  • 15
  • Does "p4 copy" do the copy on server side? – Calmarius Jun 27 '13 at 09:03
  • So `p4 populate` is a server-side `p4 branch`? – RJFalconer Aug 19 '13 at 15:36
  • 'p4 copy' can be run entirely server side with the -v flag. 'p4 populate' is like 'p4 copy' combined with 'p4 submit'. It branches and submits the files in one command. – Matt Jan 27 '14 at 21:18
  • 12
    This feels a little unsatisfactory because `p4 integrate`, `p4 move`, `p4 copy`, and `p4 populate` can all copy files to a location where no files previously existed. – jamesdlin Feb 07 '14 at 14:59
2

From the Perforce manual:

branch

(noun) A set of related files created by copying files, as opposed to adding files. A group of related files is often referred to as a codeline.

(verb) To create a branch.

integrate

To create new files from existing files, preserving their ancestry (branching), or to propagate changes from one set of files to another (merging).

merge

The process of combining the contents of two conflicting file revisions into a single file, typically using a merge tool like P4Merge.

resolve

The process you use to reconcile the differences between two revisions of a file. You can choose to resolve conflicts by selecting a file to be submitted or by merging the contents of conflicting files.

pepsi
  • 6,505
  • 6
  • 40
  • 69
  • The link was broken for me, maybe should be changed to [here](https://www.perforce.com/perforce/doc.current/manuals/p4guide/Content/P4Guide/chapter.codelines.html). However, I found this P4 [kb article](https://community.perforce.com/s/article/15183) more helpful with a great summary & example – CrashNeb Mar 10 '21 at 18:16
1

From Calmarius Jun 27 '13 at 9:03:

Does "p4 copy" do the copy on server side?

If you are asking if Perforce stores an extra copy of each file on the server, then the answer is no. The copy is still just a reference to the single instance of the file in the Perforce depot storage area.

pdxdev
  • 33
  • 5