{"id":255,"date":"2010-05-13T10:59:06","date_gmt":"2010-05-13T10:59:06","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2010\/05\/13\/most-user-p4-command-line\/"},"modified":"2018-09-28T12:06:40","modified_gmt":"2018-09-28T12:06:40","slug":"most-user-p4-command-line","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/most-user-p4-command-line\/","title":{"rendered":"Most User P4 Command Line &#8211; P4 Commands Reference"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4382\" src=\"http:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2010\/05\/p4-command-line.png\" alt=\"p4-command-line\" width=\"600\" height=\"400\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2010\/05\/p4-command-line.png 600w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2010\/05\/p4-command-line-300x200.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 add<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Open file(s) in a client workspace for addition to the depot.<\/span><\/p>\n<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>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 add -t binary file.pdf <\/span><\/p>\n<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>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 add -c 13 *<\/span><\/p>\n<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>\n<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>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 add README ~\/src\/*.c<\/span><\/p>\n<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>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 add -f *.c<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 admin<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Perform administrative operations on the server.<\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Stop the Perforce server<\/span><\/p>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 admin stop <\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 change<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Create or edit a changelist specification.<\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Create a new changelist.<\/span><\/p>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 change<\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Edit previously submitted changelist 25. Administrator or superuser access is required.<\/span><\/p>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 change -f 25<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 changelists<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">List submitted and pending changelists.<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 delete<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Open file(s) in a client workspace for deletion from the depot.<\/span><\/p>\n<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>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 delete \/\/depot\/README<\/span><\/p>\n<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>\n<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>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 edit<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Opens file(s) in a client workspace for edit.<\/span><\/p>\n<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>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 edit -t text+k doc\/*.txt<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 have<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">List files and revisions that have been synced to the client workspace<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 info<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Display information about the current client and server.<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 integrate<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Open files for branching or merging.<\/span><\/p>\n<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>\n<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>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 integ \/\/depot\/dev\/&#8230; \/\/depot\/rel2\/&#8230;<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 job<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Create or edit a defect, enhancement request, or other job specification.<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 login<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Log in to a Perforce server by obtaining a ticket.<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 passwd<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Change a user\u2019s Perforce password on the server.<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 resolve<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Resolve conflicts between file revisions.<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 revert<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Discard changes made to open files.<\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Revert all open files to their pre-opened state.<\/span><\/p>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 revert \/\/depot\/&#8230;<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 submit<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Send changes made to open files to the depot.<\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Submit the default changelist. The user\u2019s revisions of the files in this changelist are stored in the depot.<\/span><\/p>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 submit<\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Submit changelist 41.<\/span><\/p>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 submit -c 41<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 sync<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Copy files from the depot into the workspace.<\/span><\/p>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 sync<\/span><\/p>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 sync file.c#4<\/span><\/p>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 sync \/\/depot\/proj1\/&#8230;@21<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>p4 user<\/b><\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Create or edit Perforce user specifications and preferences.<\/span><\/p>\n<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>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 user joe<\/span><\/p>\n<p><span style=\"font-family: Palatino-Roman; font-size: small;\">Edit the user specification for the current Perforce user.<\/span><\/p>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 user<\/span><\/p>\n<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>\n<p><span style=\"font-family: Courier; font-size: small;\">p4 user -d sammy<\/span><\/p>\n<p><span style=\"font-family: Helvetica-Bold; font-size: large;\"><b>P4CONFIG<\/b><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>p4 add Open file(s) in a client workspace for addition to the depot. Assigns a specific file type to a new file, overriding any settings in the typemap table p4&#8230; <\/p>\n","protected":false},"author":1,"featured_media":4382,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[370],"tags":[4152,1961,4150,4154,4151,4155,4148,4149,4157,4153,3204,4147,4156],"class_list":["post-255","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-perforce","tag-list-of-p4-commands","tag-p4-command-line","tag-p4-command-line-guide","tag-p4-command-line-introduction","tag-p4-command-line-list","tag-p4-command-line-quick-guide","tag-p4-command-line-reference","tag-p4-command-reference","tag-p4-commands-for-users","tag-p4-commands-overview","tag-perforce-command-line","tag-perforce-p4-commands","tag-user-p4-commands"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=255"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/255\/revisions"}],"predecessor-version":[{"id":4383,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/255\/revisions\/4383"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/4382"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}