<?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 CheatSheet Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/perforce-command-line-cheatsheet/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/perforce-command-line-cheatsheet/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 27 Feb 2021 09:09:51 +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>
	</channel>
</rss>
