<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Perforce command-line Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/perforce-command-line/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/perforce-command-line/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 27 Feb 2021 09:55:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Perforce Command Line Global Options</title>
		<link>https://www.scmgalaxy.com/tutorials/perforce-command-line-global-options/</link>
					<comments>https://www.scmgalaxy.com/tutorials/perforce-command-line-global-options/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Tue, 09 Jan 2018 06:17:30 +0000</pubDate>
				<category><![CDATA[Perforce]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[p4 Command Line]]></category>
		<category><![CDATA[Perforce Command Line CheatSheet]]></category>
		<category><![CDATA[Perforce command-line]]></category>
		<category><![CDATA[Perforce command-line Reference]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=4572</guid>

					<description><![CDATA[<p>&#60;!&#8211; .style1 { font-size: 24px; font-weight: bold; } &#8211;&#62; Perforce Command Line Global Options Global options for Perforce commands; these [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/perforce-command-line-global-options/">Perforce Command Line Global Options</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>&lt;!&#8211; .style1 { font-size: 24px; font-weight: bold; } &#8211;&gt;</p>
<p><strong>Perforce Command Line Global Options</strong></p>
<p><a name="1040703"></a>Global options for Perforce commands; these options can be supplied on the command line before any Perforce command.</p>
<div><strong><a name="1045522"></a>Syntax</strong></div>
<div><a name="1045523"></a>p4 [-cclient -ddir -Hhost -pport -Ppass -uuser -xfile -Ccharset -Qcharset -Llanguage] [-G] [-s] [-z tag] cmd [args &#8230;]<br />
p4 -V<br />
p4 -h</div>
<p>&nbsp;</p>
<div><a name="1045577"></a><strong>Options</strong></div>
<table border="0" cellspacing="0">
<caption> </caption>
<tbody>
<tr>
<td>
<div><a name="1045526"></a>-c client</div>
</td>
<td>
<div><a name="1045530"></a>Overrides any <a href="http://www.perforce.com/perforce/doc.current/manuals/cmdref/env.P4CLIENT.html#1040647">P4CLIENT</a> setting with the specified client name.</div>
</td>
</tr>
<tr>
<td>
<div><a name="1045532"></a>-d dir</div>
</td>
<td>
<div><a name="1045535"></a>Overrides any <a href="http://www.perforce.com/perforce/doc.current/manuals/cmdref/env.PWD.html#1040647">PWD</a> setting (i.e. current working directory) and replaces it with the specified directory.</div>
</td>
</tr>
<tr>
<td>
<div><a name="1045537"></a>-G</div>
</td>
<td>
<div><a name="1045540"></a>Causes all output (and batch input for form commands with -i) to be formatted as marshalled Python dictionary objects. This is most often used when scripting.</div>
</td>
</tr>
<tr>
<td>
<div><a name="1045542"></a>-H host</div>
</td>
<td>
<div><a name="1045545"></a>Overrides any <a href="http://www.perforce.com/perforce/doc.current/manuals/cmdref/env.P4HOST.html#1040647">P4HOST</a> setting and replaces it with the specified hostname.</div>
</td>
</tr>
<tr>
<td>
<div><a name="1045547"></a>-p port</div>
</td>
<td>
<div><a name="1045550"></a>Overrides any <a href="http://www.perforce.com/perforce/doc.current/manuals/cmdref/env.P4PORT.html#1040647">P4PORT</a> setting with the specified port number.</div>
</td>
</tr>
<tr>
<td>
<div><a name="1045552"></a>-P pass</div>
</td>
<td>
<div><a name="1045555"></a>Overrides any <a href="http://www.perforce.com/perforce/doc.current/manuals/cmdref/env.P4PASSWD.html#1040647">P4PASSWD</a> setting with the specified password.</div>
</td>
</tr>
<tr>
<td>
<div><a name="1045584"></a>-s</div>
</td>
<td>
<div><a name="1045587"></a>Prepends a descriptive field (for example, text:, info:, error:, exit:) to each line of output produced by a Perforce command. This is most often used when scripting.</div>
</td>
</tr>
<tr>
<td>
<div><a name="1045557"></a>-u user</div>
</td>
<td>
<div><a name="1045560"></a>Overrides any <a href="http://www.perforce.com/perforce/doc.current/manuals/cmdref/env.P4USER.html#1040647">P4USER</a>, USER, or USERNAME setting with the specified user name.</div>
</td>
</tr>
<tr>
<td>
<div><a name="1045567"></a>-x file</div>
</td>
<td>
<div><a name="1045569"></a>Instructs Perforce to read arguments, one per line, from the specified file. If file is a single hyphen (-), then standard input is read.</div>
</td>
</tr>
<tr>
<td>
<div><a name="1048258"></a>-C charset</div>
</td>
<td>
<div><a name="1048260"></a>Overrides any <a href="http://www.perforce.com/perforce/doc.current/manuals/cmdref/env.P4CHARSET.html#1040647">P4CHARSET</a> setting with the specified character set.</div>
</td>
</tr>
<tr>
<td>
<div><a name="1048527"></a>-Q charset</div>
</td>
<td>
<div><a name="1048530"></a>Overrides any <a href="http://www.perforce.com/perforce/doc.current/manuals/cmdref/env.P4COMMANDCHARSET.html#1040647">P4COMMANDCHARSET</a> setting with the specified character set.</div>
</td>
</tr>
<tr>
<td>
<div><a name="1048273"></a>-L language</div>
</td>
<td>
<div><a name="1048275"></a>This feature is reserved for system integrators.</div>
</td>
</tr>
<tr>
<td>
<div><a name="1048678"></a>-z tag</div>
</td>
<td>
<div><a name="1048680"></a>Causes output of many reporting commands to be in the same tagged format as that generated by <a href="http://www.perforce.com/perforce/doc.current/manuals/cmdref/fstat.html#1040665">p4 fstat</a>.</div>
</td>
</tr>
<tr>
<td>
<div><a name="1045590"></a>-V</div>
</td>
<td>
<div><a name="1045592"></a>Displays the version of the p4 client program and exits.</div>
</td>
</tr>
<tr>
<td>
<div><a name="1048266"></a>-h</div>
</td>
<td>
<div><a name="1048268"></a>Displays basic usage information and exits.</div>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<div><a name="1040576"></a><strong>Usage Notes</strong></div>
<div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>•</div>
</td>
<td>
<div><a name="1040577"></a>Be aware that the global options must be specified on the command line before the Perforce command. Options specified after the Perforce command will not be interpreted as global options, but as options for the command being invoked. It is therefore possible to have the same command line option appearing twice in the same command, being interpreted differently each time.</div>
</td>
</tr>
</tbody>
</table>
</div>
<div><a name="1040777"></a>For example, the command p4 -c anotherclient edit -c 140 file.c will open file file.c for edit in pending changelist 140 under client workspace anotherclient.</div>
<div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>•</div>
</td>
<td>
<div><a name="1040722"></a>The -x option is useful for automating tedious tasks; a user adding several files at once could create a text file with the names of these files and invoke p4 -x textfile add to add them all at once.</div>
</td>
</tr>
</tbody>
</table>
</div>
<div><a name="1040723"></a>The -x option can be extremely powerful &#8211; as powerful as whatever generates its input. For example, a UNIX developer wishing to edit any file referring to an included file.h file, for instance, could grep -l file.h *.c | cut -f1 -d: | p4 -x &#8211; edit.</div>
<div><a name="1040778"></a>In this example, the grep command lists occurrences of file.h in the *.c files, the -l option tells grep to list each file only once, and the cut command splits off the filename from grep&#8217;s output before passing it to the p4 -x command.</div>
<div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>•</div>
</td>
<td>
<div><a name="1040724"></a>The -s option can be useful in automated scripts.</div>
</td>
</tr>
</tbody>
</table>
</div>
<div><a name="1040776"></a>For example, a script could be written as part of an in-house build process which executes p4 -s commands, discards any output lines beginning with &#8220;info:&#8221;, and alerts the user if any output lines begin with &#8220;error:&#8221;.</div>
<div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>•</div>
</td>
<td>
<div><a name="1045402"></a>Python developers will find the -G option extremely useful for scripting. For instance, to get a dictionary of all fields of a job whose ID is known, use the following:</div>
</td>
</tr>
</tbody>
</table>
</div>
<div><a name="1045409"></a>job_dict = marshal.load(os.popen(&#8216;p4 -G job -o &#8216; + job_id, &#8216;rb&#8217;))</div>
<div><a name="1048244"></a>In some cases, it may not be intuitively obvious what keys are used by the client program. If you pipe the output of any p4 -G invocation to the following script, you will see every record printed out in key/value pairs:</div>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/perforce-command-line-global-options/">Perforce Command Line Global Options</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/perforce-command-line-global-options/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Perforce Command Line</title>
		<link>https://www.scmgalaxy.com/tutorials/perforce-command-line/</link>
					<comments>https://www.scmgalaxy.com/tutorials/perforce-command-line/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Tue, 09 Jan 2018 06:13:04 +0000</pubDate>
				<category><![CDATA[Perforce]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[p4 Command Line]]></category>
		<category><![CDATA[Perforce Command Line CheatSheet]]></category>
		<category><![CDATA[Perforce command-line]]></category>
		<category><![CDATA[Perforce command-line Reference]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=4570</guid>

					<description><![CDATA[<p>Command Description p4 add Open file(s) in a client workspace for addition to the depot. p4 admin Perform administrative operations [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/perforce-command-line/">Perforce Command Line</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<table border="1" width="100%" cellspacing="0" cellpadding="0">
<colgroup>
<col width="95" /></colgroup>
<tbody>
<tr>
<td></td>
<td>
<h1>Command</h1>
</td>
<td>
<h1>Description</h1>
</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 add</div>
</td>
<td>Open file(s) in a client workspace for addition to the depot.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 admin</div>
</td>
<td>Perform administrative operations on the server.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 branch</div>
</td>
<td>Create or edit a branch specification and its view.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 change</div>
</td>
<td>Create or edit a changelist specification.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 changelists</div>
</td>
<td>List submitted and pending changelists.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 changelist</div>
</td>
<td>Create or edit a changelist specification.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 client</div>
</td>
<td>Create or edit a client workspace specification and its view.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 clients</div>
</td>
<td>List all client workspaces currently known to the system.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 delete</div>
</td>
<td>Open file(s) in a client workspace for deletion from the depot.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 depot</div>
</td>
<td>Create or edit a depot specification.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 depots</div>
</td>
<td>Display a list of depots known to the Perforce server.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 describe</div>
</td>
<td>Provides information about changelists and the changelists’ files.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 groups</div>
</td>
<td>List groups of users.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 group</div>
</td>
<td>Add or delete users from a group, or set the maxresults, maxscanrows, and timeout limits for the members of a group.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 have</div>
</td>
<td>List files and revisions that have been synced to the client workspace</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 info</div>
</td>
<td>Display information about the current client and server.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 integrate</div>
</td>
<td>Open files for branching or merging.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 integrated</div>
</td>
<td>Show integrations that have been submitted.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 job</div>
</td>
<td>Create or edit a defect, enhancement request, or other job specification.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 jobs</div>
</td>
<td>List jobs known to the Perforce server.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 label</div>
</td>
<td>Create or edit a label specification and its view.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 labels</div>
</td>
<td>Display list of defined labels.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 lock</div>
</td>
<td>Lock an opened file against changelist submission.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 login</div>
</td>
<td>Log in to a Perforce server by obtaining a ticket.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 logout</div>
</td>
<td>Log out of a Perforce server by removing or invalidating a ticket.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 passwd</div>
</td>
<td>Change a user’s Perforce password on the server.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 rename</div>
</td>
<td>Renaming files under Perforce.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 resolve</div>
</td>
<td>Resolve conflicts between file revisions.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 revert</div>
</td>
<td>Discard changes made to open files.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 set</div>
</td>
<td>Set Perforce variables in the Windows registry.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 submit</div>
</td>
<td>Send changes made to open files to the depot.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 sync</div>
</td>
<td>Copy files from the depot into the workspace.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 tag</div>
</td>
<td>Tag files with a label.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 triggers</div>
</td>
<td>Edit a list of scripts to be run conditionally whenever changelists are submitted, forms are updated, or when integrating Perforce with external authentication mechanisms.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 user</div>
</td>
<td>Create or edit Perforce user specifications and preferences.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 users</div>
</td>
<td>Print a list of all known users of the current server.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 verify</div>
</td>
<td>Verify that the server archives are intact.</td>
</tr>
<tr>
<td></td>
<td>
<div>p4 workspace</div>
</td>
<td>Create or edit a client workspace specification and its view.</td>
</tr>
</tbody>
</table>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/perforce-command-line/">Perforce Command Line</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/perforce-command-line/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Most User P4 Command Line &#8211; P4 Commands Reference</title>
		<link>https://www.scmgalaxy.com/tutorials/most-user-p4-command-line/</link>
					<comments>https://www.scmgalaxy.com/tutorials/most-user-p4-command-line/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Thu, 13 May 2010 10:59:06 +0000</pubDate>
				<category><![CDATA[Perforce]]></category>
		<category><![CDATA[List of P4 Commands]]></category>
		<category><![CDATA[p4 Command Line]]></category>
		<category><![CDATA[P4 Command line Guide]]></category>
		<category><![CDATA[P4 Command line introduction]]></category>
		<category><![CDATA[P4 Command line list]]></category>
		<category><![CDATA[P4 COmmand line quick guide]]></category>
		<category><![CDATA[p4 command line reference]]></category>
		<category><![CDATA[P4 Command Reference]]></category>
		<category><![CDATA[p4 commands for users]]></category>
		<category><![CDATA[P4 Commands overview]]></category>
		<category><![CDATA[Perforce command-line]]></category>
		<category><![CDATA[Perforce p4 commands]]></category>
		<category><![CDATA[User p4 commands]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2010/05/13/most-user-p4-command-line/</guid>

					<description><![CDATA[<p>p4 add Open file(s) in a client workspace for addition to the depot. Assigns a specific file type to a [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/most-user-p4-command-line/">Most User P4 Command Line &#8211; P4 Commands Reference</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4382" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/05/p4-command-line.png" alt="p4-command-line" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/05/p4-command-line.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2010/05/p4-command-line-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 add</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Open file(s) in a client workspace for addition to the depot.</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Assigns a specific file type to a new file, overriding any settings in the typemap table</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 add -t binary file.pdf </span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Opens all the files within the user&#8217;s current directory for </span><span style="font-family: Courier; font-size: small;">add</span><span style="font-family: Palatino-Roman; font-size: small;">, and links these files to changelist </span><span style="font-family: Courier; font-size: small;">13</span><span style="font-family: Palatino-Roman; font-size: small;">.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 add -c 13 *</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Opens all </span><span style="font-family: Courier; font-size: small;">*.c </span><span style="font-family: Palatino-Roman; font-size: small;">files in the user&#8217;s </span><span style="font-family: Courier; font-size: small;">~/src </span><span style="font-family: Palatino-Roman; font-size: small;">directory for </span><span style="font-family: Courier; font-size: small;">add</span><span style="font-family: Palatino-Roman; font-size: small;">; also opens the </span><span style="font-family: Courier; font-size: small;">README </span><span style="font-family: Palatino-Roman; font-size: small;">file in the user&#8217;s current working</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">directory for </span><span style="font-family: Courier; font-size: small;">add</span><span style="font-family: Palatino-Roman; font-size: small;">. These files are linked to the default changelist.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 add README ~/src/*.c</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Opens a file named </span><span style="font-family: Courier; font-size: small;">*.c </span><span style="font-family: Palatino-Roman; font-size: small;">for </span><span style="font-family: Courier; font-size: small;">add</span><span style="font-family: Palatino-Roman; font-size: small;">.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 add -f *.c</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 admin</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Perform administrative operations on the server.</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Stop the Perforce server</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 admin stop </span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 change</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Create or edit a changelist specification.</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Create a new changelist.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 change</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Edit previously submitted changelist 25. Administrator or superuser access is required.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 change -f 25</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 changelists</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">List submitted and pending changelists.</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 delete</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Open file(s) in a client workspace for deletion from the depot.</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Opens the file called </span><span style="font-family: Courier; font-size: small;">README </span><span style="font-family: Palatino-Roman; font-size: small;">in the depot&#8217;s top level directory for deletion. The corresponding file within the client workspace is immediately deleted, but the file is not deleted from the depot until the default changelist is submitted.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 delete //depot/README</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Opens </span><span style="font-family: Courier-Oblique; font-size: small;"><i>file </i></span><span style="font-family: Palatino-Roman; font-size: small;">in the current client workspace for deletion. The file is immediately removed from the client orkspace, but won&#8217;t be deleted from the depot until changelist 40 is sent to the server with </span><span style="font-family: Courier; font-size: small;">p4 submit</span><span style="font-family: Palatino-Roman; font-size: small;">.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 delete -c 40 </span><span style="font-family: Courier-Oblique; font-size: small;"><i>file</i></span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 edit</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Opens file(s) in a client workspace for edit.</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Opens all files ending in </span><span style="font-family: Courier; font-size: small;">.txt </span><span style="font-family: Palatino-Roman; font-size: small;">within the current directory&#8217;s </span><span style="font-family: Courier; font-size: small;">doc </span><span style="font-family: Palatino-Roman; font-size: small;">subdirectory for </span><span style="font-family: Courier; font-size: small;">edit</span><span style="font-family: Palatino-Roman; font-size: small;">. These files are linked to the default changelist; these files are stored as type </span><span style="font-family: Courier; font-size: small;">text </span><span style="font-family: Palatino-Roman; font-size: small;">with keyword expansion.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 edit -t text+k doc/*.txt</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 have</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">List files and revisions that have been synced to the client workspace</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 info</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Display information about the current client and server.</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 integrate</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Open files for branching or merging.</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Branch or merge all files in </span><span style="font-family: Courier; font-size: small;">//depot/dev/&#8230; </span><span style="font-family: Palatino-Roman; font-size: small;">to the corresponding files in</span></p>
<p><span style="font-family: Courier; font-size: small;">//depot/rel2/&#8230; </span><span style="font-family: Palatino-Roman; font-size: small;">If there is no corresponding file in </span><span style="font-family: Courier; font-size: small;">//depot/rel2/&#8230;</span><span style="font-family: Palatino-Roman; font-size: small;">, this creates it.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 integ //depot/dev/&#8230; //depot/rel2/&#8230;</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 job</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Create or edit a defect, enhancement request, or other job specification.</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 login</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Log in to a Perforce server by obtaining a ticket.</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 passwd</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Change a user’s Perforce password on the server.</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 resolve</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Resolve conflicts between file revisions.</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 revert</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Discard changes made to open files.</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Revert all open files to their pre-opened state.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 revert //depot/&#8230;</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 submit</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Send changes made to open files to the depot.</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Submit the default changelist. The user’s revisions of the files in this changelist are stored in the depot.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 submit</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Submit changelist 41.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 submit -c 41</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 sync</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Copy files from the depot into the workspace.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 sync</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 sync file.c#4</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 sync //depot/proj1/&#8230;@21</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>p4 user</b></span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Create or edit Perforce user specifications and preferences.</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">View the user specification of Perforce user </span><span style="font-family: Courier; font-size: small;">joe</span><span style="font-family: Palatino-Roman; font-size: small;">.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 user joe</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Edit the user specification for the current Perforce user.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 user</span></p>
<p><span style="font-family: Palatino-Roman; font-size: small;">Delete the user specification for the Perforce user </span><span style="font-family: Courier; font-size: small;">sammy</span><span style="font-family: Palatino-Roman; font-size: small;">.</span></p>
<p><span style="font-family: Courier; font-size: small;">p4 user -d sammy</span></p>
<p><span style="font-family: Helvetica-Bold; font-size: large;"><b>P4CONFIG</b></span></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/most-user-p4-command-line/">Most User P4 Command Line &#8211; P4 Commands Reference</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/most-user-p4-command-line/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>“Cheat Sheet” of Perforce command-line &#124; Perforce command-line Guide</title>
		<link>https://www.scmgalaxy.com/tutorials/cheat-sheet-of-perforce-command-line/</link>
					<comments>https://www.scmgalaxy.com/tutorials/cheat-sheet-of-perforce-command-line/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Sat, 20 Jun 2009 04:59:12 +0000</pubDate>
				<category><![CDATA[Perforce]]></category>
		<category><![CDATA[Cheat Sheet]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[Data-mining commands]]></category>
		<category><![CDATA[p4]]></category>
		<category><![CDATA[p4 changes]]></category>
		<category><![CDATA[p4 filelog]]></category>
		<category><![CDATA[p4 files]]></category>
		<category><![CDATA[P4V]]></category>
		<category><![CDATA[Perforce Command Reference]]></category>
		<category><![CDATA[Perforce command-line]]></category>
		<category><![CDATA[Perforce command-line Cheat Sheet]]></category>
		<category><![CDATA[Perforce command-line Guide]]></category>
		<category><![CDATA[Perforce command-line Help]]></category>
		<category><![CDATA[Perforce command-line List]]></category>
		<category><![CDATA[Perforce command-line Reference]]></category>
		<category><![CDATA[Perforce command-line Resource]]></category>
		<category><![CDATA[Perforce command-line Tutorial]]></category>
		<category><![CDATA[Reference guide]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2009/06/20/cheat-sheet-of-perforce-command-line/</guid>

					<description><![CDATA[<p>A way to remember data-mining commands The following is a set of questions that will be used during the Perforce [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/cheat-sheet-of-perforce-command-line/">“Cheat Sheet” of Perforce command-line | Perforce command-line Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="aligncenter wp-image-4061 size-full" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2009/06/perforce-command-line-cheat.png" alt="perforce-command-line-cheatsheet" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2009/06/perforce-command-line-cheat.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2009/06/perforce-command-line-cheat-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<table border="0" width="100%">
<tbody>
<tr>
<td class="HEADING">A way to remember data-mining commands</td>
</tr>
<tr>
<td class="HEADING_BODY">The following is a set of questions that will be used during the Perforce training to remind students which “data-mining” commands to use for specific situations. Perforce is a terrific tool, but it’s easy to get lost in the choices between “p4 files” and “p4 changes” and “p4 filelog” and so on. This list can help a great deal.</p>
<table border="1" width="100%">
<tbody>
<tr>
<td bgcolor="#666666">
<div align="center"><strong><span style="color: #ffffff;">the question starts with…</span></strong></div>
</td>
<td bgcolor="#666666">
<div align="center"><strong><span style="color: #ffffff;">the answer starts with…<br />
</span></strong></div>
</td>
<td bgcolor="#666666">
<div align="center"><strong><span style="color: #ffffff;">Examples</span></strong></div>
</td>
</tr>
<tr>
<td>“What are the filenames that…?”</td>
<td>“p4 files….”</td>
<td>p4 files //depot/…#have<br />
p4 have<br />
p4 files //depot/…<br />
(which is the same as)<br />
p4 files //depot/…#head<br />
p4 files //depot/…@label<br />
p4 files //depot/…@client<br />
p4 files //depot/…@2001/02/12<br />
p4 files //depot/…@1541</td>
</tr>
<tr>
<td>“What are the differences between the<br />
workspace copy of XXX and the depot<br />
copy of XXX?”</td>
<td>“p4 diff …”</td>
<td>• p4 diff file.c<br />
• p4 diff file.c#2<br />
• p4 diff file.c#head<br />
• p4 diff //… or “p4 diff”<br />
• p4 diff –se</td>
</tr>
<tr>
<td>“What are the differences the depot copy<br />
of ______ and the depot copy of ______?”</td>
<td>“p4 diff2 ….”</td>
<td>• p4 diff2 file1.c file2.c<br />
• p4 diff2 file1.c#1 file.c#2<br />
• p4 diff2 dir1/… dir2/…<br />
• p4 diff2 dir1/…@now dir1/…@2000/01/02</td>
</tr>
<tr>
<td>“Tell me everything about changelist #___.”</td>
<td>“p4 describe”</td>
<td>• p4 describe 1231</td>
</tr>
<tr>
<td>“What’s a list of changelists that….?”</td>
<td>“p4 changes….”</td>
<td>• p4 changes<br />
(which is the same as)<br />
p4 changes //…<br />
• p4 changes file.c<br />
• p4 changes –i file.c | grep 1255<br />
• p4 changes //depot/…@label1,@label2</td>
</tr>
</tbody>
</table>
<p>&nbsp;</td>
</tr>
<tr>
<td class="HEADING">“Cheat Sheet” of Perforce command-line</td>
</tr>
<tr>
<td class="HEADING_BODY">The following list is a set of helpful commands that anyone can run, but that the person administering the Perforce codelines will<br />
be using a lot. They’re included here for quick reference.</p>
<table border="1" width="100%">
<tbody>
<tr>
<td align="left" valign="top" bgcolor="#999999">
<div align="center"><span style="color: #ffffff;"><strong>Function</strong></span></div>
</td>
<td align="left" valign="top" bgcolor="#999999">
<div align="center"><span style="color: #ffffff;"><strong>Commands</strong></span></div>
</td>
</tr>
<tr>
<td align="left" valign="top">Create a new workspace…<br />
1. That’s modeled after the<br />
“1.0dev” workspace – same<br />
mappings<br />
2. That’s the Perforce defaults,</td>
<td align="left" valign="top">Set the workspace name using “p4 set” or in the environment. Then run:<br />
1. p4 client –t 1.0dev<br />
2. p4 client</td>
</tr>
<tr>
<td align="left" valign="top">Retrieve a file as of<br />
1. Now (head revision)<br />
2. April 15, 2000<br />
3. Label “xyz”<br />
4. Changelist 123456<br />
5. the revision that client<br />
“jab.work” has retrieved<br />
6. The revision you had before<br />
accidently bashing your disk</td>
<td align="left" valign="top">Use “p4 sync” as follows:<br />
1. p4 sync file.java<br />
p4 sync file.java#head<br />
p4 sync file.java@now<br />
2. p4 sync file.java@2000/04/15<br />
3. p4 sync file.java@xyz<br />
4. p4 sync file.java@123456<br />
5. p4 sync file.java@jab.work<br />
6. p4 sync –f file.java#have<br />
See “p4 help revisions” for more examples. Note that anywhere that “file.java” is used in these<br />
examples, a full pathname (“c:\work\projects\file.java”) or depot name<br />
(“//depot/rel_218/base/projects/file.java”) could be used.</td>
</tr>
<tr>
<td align="left" valign="top">Open a file for:<br />
1. add<br />
2. edit<br />
3. delete<br />
And then publish the change to others<br />
.</td>
<td align="left" valign="top">Use “p4” with the appropriate verb:<br />
• p4 add file.java<br />
• p4 edit file.java<br />
• p4 delete file.java<br />
Then “p4 submit” to publish it</td>
</tr>
<tr>
<td align="left" valign="top">What have I changed in the files I<br />
have opened for edit?</td>
<td align="left" valign="top">• p4 diff (for all opened files)<br />
• p4 diff file1 file2 (for specific files)</td>
</tr>
<tr>
<td align="left" valign="top">Undo a checkout.</td>
<td align="left" valign="top">If the file hasn’t been submitted yet:<br />
• Use “p4 revert –a” to find all opened files that have no modifications – it’ll revert those.<br />
• Use “p4 revert file.java” to revert an individual file.<br />
• Use “p4 revert //…” to revert all files.<br />
Remember that “p4 revert” is irreversible.<br />
If the file has been submitted, you’ll need to open the file for edit and check in a prior revision.<br />
Use very good change descriptions to say what you did and why.</td>
</tr>
<tr>
<td align="left" valign="top">Interrupt your work to edit a single<br />
file and check it in, without any other<br />
disruptions. (You’re hacking Java and<br />
someone needs a “relnotes.txt”<br />
updated ASAP to issue a release.)</td>
<td align="left" valign="top">Two ways:<br />
1. Edit the file and submit only that file.<br />
• p4 edit relnotes.txt<br />
• do the modifications<br />
• p4 submit relnotes.txt<br />
2. Make a new changelist to manage just that change.<br />
• p4 change<br />
remove all the files in this change from the Files: section, it’ll create an empty<br />
change.<br />
• p4 edit –c XXX relnotes.txt<br />
where XXX is the change number in the previous step<br />
• p4 submit –c XXX</td>
</tr>
<tr>
<td align="left" valign="top">Publish your work to others</td>
<td align="left" valign="top">“p4 submit”</td>
</tr>
<tr>
<td align="left" valign="top">Compress the data on the net<br />
because you have a slow modem line<br />
between your workspace and the<br />
server.</td>
<td align="left" valign="top">Run “p4 client” for your workspace, and change the options from “nocompress” to “compress”.<br />
(Read “p4 help client” for details.)</td>
</tr>
<tr>
<td align="left" valign="top">Get the list of…<br />
1. All changelists applied to the<br />
base codeline<br />
2. … to the prodxyz codeline<br />
3. … to the prodxyz codeline,<br />
including those applied<br />
originally to another codeline<br />
and integrated into prodxyz<br />
4. All revisions of file.java</td>
<td align="left" valign="top">Use “p4 changes” or “p4 filelog” as follows:<br />
1. p4 changes //depot/eng/…<br />
2. p4 changes //depot/eng/prodxyz/…<br />
3. p4 changes –i //depot/eng/prodxyz/…<br />
4. p4 filelog file.java</td>
</tr>
<tr>
<td align="left" valign="top">Push … from the base codeline<br />
(“prodxyz”) to the 1.0.1 codeline<br />
(“prodxyz-1.0.1”):<br />
1. Push change #1232<br />
2. From change #129 to #134<br />
3. all changes in the base<br />
codeline</td>
<td align="left" valign="top">Use “p4 integrate –b prodxyz-1.0.1” as the place to start, in each case:<br />
1. p4 integ –b prodxyz-1.0.1 //…@=1232<br />
2. p4 integ –b prodxyz-1.0.1 //…@129,@134<br />
3. p4 integ –b prodxyz-1.0.1 (no additional args)<br />
Note that this assumes that the named branch specification “prodxyz-1.0.1” has been created<br />
by your project lead or administrator using “p4 branch”.</td>
</tr>
<tr>
<td align="left" valign="top">Push … from the prodxyz-1.0.1<br />
codeline to the base (“prodxyz”)<br />
codeline:<br />
1. Push change #1235<br />
2. From change #127 to #128<br />
3. all changes in the base</td>
<td align="left" valign="top">Use “p4 integrate –b prodxyz-1.0.1” as the place to start, in each case:<br />
1. p4 integ –b prodxyz-1.0.1 –r @=1235<br />
2. p4 integ –b prodxyz-1.0.1 –r //…@127,@128<br />
3. p4 integ –b prodxyz-1.0.1 –r (no additional args)<br />
The “-r” reverses the order of source/target in that named branch specification.<br />
Note that for the ‘selective integration’ cases, you’ll want to be VERY CAUTIOUS of ‘accept<br />
theirs’.</td>
</tr>
<tr>
<td align="left" valign="top">Show the ‘diff’ between the<br />
prodxyz-1.0.1 codeline and its<br />
parent</td>
<td align="left" valign="top">“p4 diff2 –b prodxyz-1.0.1” (This works because “prodxyz” is the name of the branch<br />
specification, not because “prodxyz” is part of “//depot/prodxyz/…”)</td>
</tr>
<tr>
<td align="left" valign="top">What branches do I have?</td>
<td align="left" valign="top">If you use “p4 branch” to create branch specifications and use them consistently, then “p4<br />
branches” provides this info.</td>
</tr>
<tr>
<td align="left" valign="top">How do I make a new codeline<br />
named prodxyz-2.0?</td>
<td align="left" valign="top">There are several steps:<br />
1. Make a named branch specification. Save it.<br />
• “p4 prodxyz-2.0”<br />
• if you want to exactly imitate another branch (e.g. prodxyz), use<br />
“p4 branch –o prodxyz-1.0.1 &gt; tmp” to capture the output, edit this temporary file<br />
and replace the “1.0.1” references with “2.0”, then run “p4 branch –i &lt; tmp”.<br />
2. Run the “p4 integrate” command to populate this new codeline. Submit the change.<br />
• p4 integrate –b prodxyz-2.0<br />
or, if you want to push content as of a certain label (e.g. “xyz”) from the parent,<br />
p4 integrate –b prodxyz-2.0 //…@xyz<br />
• p4 submit<br />
3. Send e-mail telling everyone about this codeline and what it’s used for.</td>
</tr>
<tr>
<td align="left" valign="top">Put everything onto a laptop, you’re<br />
going to the beach and want to hack.<br />
(This assumes that you won’t be<br />
connected to a net while away.)</td>
<td align="left" valign="top">There are several steps:<br />
1. Connect the laptop to the net.<br />
2. Run “p4 sync” to populate the source onto the laptop.<br />
3. Leave for the beach.<br />
4. While editing, use “chmod” or “attrib” to make the files writeable. Make your changes.<br />
5. Get back to work, reconnect to the net.<br />
6. Run the following commands to tell you what’s updated and open them for<br />
add/edit/delete:<br />
• p4 diff –se | p4 –x – edit<br />
• p4 diff –sd | p4 –x – delete<br />
• find . –type f –print | p4 –x – add<br />
Then inspect what’s opened (“p4 opened”) and what you’ve changed (“p4 diff”). Submit or<br />
revert as appropriate.</td>
</tr>
<tr>
<td align="left" valign="top">Run a checkpoint</td>
<td align="left" valign="top">“p4 admin checkpoint” – only an administrator can run this. (An administrator has “super”<br />
permissions in the “p4 protect” data.)<br />
Be sure to back up the checkpoint, the current journal, and each of the “depot” directories on<br />
the server machine!</td>
</tr>
<tr>
<td align="left" valign="top">Change the security/permissions</td>
<td align="left" valign="top">“p4 protect” – only an administrator can run this.<br />
Also…<br />
“p4 protects” – used in 2006.1 and later to TELL you your permissions .</td>
</tr>
<tr>
<td align="left" valign="top">Make a label</td>
<td align="left" valign="top">It’s a two-step process:<br />
1. Make the label using “p4 label xxx”<br />
2. Populate it using “p4 labelsync –l xxx”<br />
or if you have a specific list of files,<br />
“p4 labelsync –l xxx file1 file2 …”.</td>
</tr>
<tr>
<td align="left" valign="top">Copy a label’s contents to another<br />
label. Assume that the existing label<br />
is “xxx” and the new label is to be<br />
“abc”.</td>
<td align="left" valign="top">Again, a two-step process:<br />
1. Make the label using “p4 label –t xxx abc”<br />
2. Populate it using<br />
“p4 labelsync –l abc //…@xxx”<br />
Note that the second step is really identical to the second step in the previous question – we’re<br />
just specifying a very specific list of revisions [of files] to include in the new label.<br />
(Also…<br />
In 2005.1 and later, “p4 tag” will make the label and apply it to a set of files.)</td>
</tr>
<tr>
<td align="left" valign="top"></td>
<td align="left" valign="top"></td>
</tr>
</tbody>
</table>
<p>&nbsp;</td>
</tr>
</tbody>
</table>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/cheat-sheet-of-perforce-command-line/">“Cheat Sheet” of Perforce command-line | Perforce command-line Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/cheat-sheet-of-perforce-command-line/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
