
Revision two might be stored as a symbolic version of the following:Īnd revision one might be a representation of this:įrom these partial file descriptions, any file revision can be reconstructed. The head revision (foo#3) looks like this: The scheme used by most SCM systems, including Perforce, is to save only the latest revision of each file, and then store the differences between each file revision and the one previous.Īs an example, suppose that a Perforce depot has three revisions of file foo. Every revision of a particular file must be retrievable, and if each revision was stored in full, disk space problems could occur: one thousand 10KB files, each with a hundred revisions, would use a gigabyte of disk space. Only the differences between revisions are storedĪ single file might have hundreds, even thousands, of revisions.

If you already understand what this means, you can skip to the next section of this chapter, as the remainder of this section explains how RCS format works. Perforce uses RCS format to store its text file revisions binary file revisions are always saved in full.

RCS Format: How Perforce Stores File Revisions This can eliminate file conflicts entirely. Perforce also provides facilities for locking files when they are edited. Resolves are always performed with p4 resolve. A resolve is automatically scheduled when a submit of a changelist fails because of a file conflict the same resolve can be scheduled manually, without submitting, by syncing the head revision of a file over an opened revision within the client workspace. Resolving a file conflict is a two-step process: first the resolve is scheduled, then the resolve is performed. The resolve process allows a choice to be made: Lisa's version can be submitted in place of Ed's, Lisa's version can be dumped in favor of Ed's, a Perforce-generated merged version of both revisions can be submitted, or the Perforce-generated merged file can be edited and then submitted. Instead, the changelist is rejected and a resolve must be performed. If Perforce were to accept Lisa's version into the depot, the head revision would contain none of Ed's changes.

If you don’t want to use p4merge as diff tool, just comment (using # character) section. Edit ~/.gitconfig file and put following configuration there for merging:Ĭmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED" & /usr/local/bin/p4merge "$2" "$PWD/$5"ĭon’t forget to add executable mode/flag to these scripts.Īfter p4merge and scripts are ready it’s time to configure global git settings. Applications/p4merge.app/Contents/MacOS/p4merge $* Create these scripts in directory that is in your’s system PATH (i.e. Second step is to create two simple bash scripts: p4merge and p4diff, that will be executed when git needs merge or diff tool. After downloading, open dmg file and copy p4merge tool to Applications folder in your Dock.
P4MERGE COMMAND LINE DOWNLOAD
Go to p4merge tool download page, choose “Browse by platform” tab, pick your platform (in my case it was Macintosh) and download P4V: Visual Client.
P4MERGE COMMAND LINE HOW TO
Is is very simple to mix together those two things to have the best from both of them and now I will show you how to do that.įirst of all, you have to install p4merge tool.
P4MERGE COMMAND LINE MANUAL
I found p4merge tool much better in case of automatic merging and manual solving the most hard conflicts. Besides of many great features is has pretty good automatic merge tool, that is able to solve conflicts, but not all of them. Git is my favorite SCV system up to now and most probably will be in the future.
