{"id":319,"date":"2012-05-16T11:27:22","date_gmt":"2012-05-16T11:27:22","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2012\/05\/16\/use-of-p4-duplicate-command\/"},"modified":"2021-02-27T09:52:53","modified_gmt":"2021-02-27T09:52:53","slug":"use-of-p4-duplicate-command","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/","title":{"rendered":"Use of p4 duplicate command | P4 Command Guide"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3825 aligncenter\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2012\/05\/p4-duplicate-command.png\" alt=\"p4-duplicate-command\" width=\"600\" height=\"400\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2012\/05\/p4-duplicate-command.png 600w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2012\/05\/p4-duplicate-command-300x200.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><strong>Use of p4 duplicate command<\/strong><\/p>\n<p><strong>Problem Area is &#8211; <\/strong><br \/>\nIs there any possibility to rename branch name? as directory rename is possible?<\/p>\n<p><strong>Solution is &#8211; <\/strong>p4 duplicate command<\/p>\n<p>What the command \u2018p4 duplicate\u2019 was implement to do was create a duplicated revision of a folder as if it always existed. This is explained in the \u2018p4 help duplicate\u2019, I have copied below:<\/p>\n<pre>Duplicate revisions as if they always existed.  All aspects of\r\n   the source revisions are mirrored into the target revisions,\r\n   including changelist number, date, attributes, and contents.\r\n   The target revision must not already exist, and the target file\r\nmust not be opened (for any operation) on any client.<\/pre>\n<p>Integration records are duplicated as well.<\/p>\n<p>To rename branch names is possible with the process of a deep rename operation.<\/p>\n<p><strong><em>p4 duplicate \/\/depot\/Jam\/MAINds\/&#8230; \/\/depot\/Jam\/MAIN\/&#8230;<\/em><\/strong><\/p>\n<p>The above command will create an exact copy of the branch you&#8217;re duplicating including its integration history.<\/p>\n<p>Then the duplication source is not wanted anymore, so you will need to use the obliterate command:<\/p>\n<p><em><strong>p4 obliterate -y \/\/depot\/Jam\/MAINds\/&#8230;<\/strong><\/em><\/p>\n<p>You can find more information about &#8220;p4 duplicate&#8221; by running the &#8220;p4 help duplicate&#8221; command.<\/p>\n<p>If you have any further questions please let me know.<\/p>\n<p>Reference &#8211;<\/p>\n<p>Perforce Support and<\/p>\n<p><a href=\"http:\/\/maillist.perforce.com\/pipermail\/perforce-user\/2010-November\/027364.html\" target=\"_blank\" rel=\"noopener\">http:\/\/maillist.perforce.com\/pipermail\/perforce-user\/2010-November\/027364.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use of p4 duplicate command Problem Area is &#8211; Is there any possibility to rename branch name? as directory rename [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":3825,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[22],"tags":[333,2520,2518,1122,545,384,2521,2523,2524,2522,2519,2525,373,213,1980],"class_list":["post-319","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-perforce","tag-command","tag-copy","tag-duplicate","tag-guide","tag-how","tag-p4","tag-p4-clone","tag-p4-commands","tag-p4-commands-guide","tag-p4-copy","tag-p4-duplicate-command","tag-p4-duplicate-tutorial","tag-perforce","tag-tutorial","tag-use"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Use of p4 duplicate command | P4 Command Guide - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Use of p4 duplicate command | P4 Command Guide - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"Use of p4 duplicate command Problem Area is &#8211; Is there any possibility to rename branch name? as directory rename [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2012-05-16T11:27:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-27T09:52:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2012\/05\/p4-duplicate-command.png\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"scmgalaxy K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"scmgalaxy K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/use-of-p4-duplicate-command\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/use-of-p4-duplicate-command\\\/\"},\"author\":{\"name\":\"scmgalaxy K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"headline\":\"Use of p4 duplicate command | P4 Command Guide\",\"datePublished\":\"2012-05-16T11:27:22+00:00\",\"dateModified\":\"2021-02-27T09:52:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/use-of-p4-duplicate-command\\\/\"},\"wordCount\":177,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/use-of-p4-duplicate-command\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2012\\\/05\\\/p4-duplicate-command.png\",\"keywords\":[\"command\",\"Copy\",\"Duplicate\",\"Guide\",\"How\",\"p4\",\"p4 clone\",\"p4 commands\",\"p4 commands guide\",\"p4 copy\",\"p4 duplicate command\",\"p4 duplicate tutorial\",\"Perforce\",\"Tutorial\",\"Use\"],\"articleSection\":[\"Perforce\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/use-of-p4-duplicate-command\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/use-of-p4-duplicate-command\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/use-of-p4-duplicate-command\\\/\",\"name\":\"Use of p4 duplicate command | P4 Command Guide - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/use-of-p4-duplicate-command\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/use-of-p4-duplicate-command\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2012\\\/05\\\/p4-duplicate-command.png\",\"datePublished\":\"2012-05-16T11:27:22+00:00\",\"dateModified\":\"2021-02-27T09:52:53+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/use-of-p4-duplicate-command\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/use-of-p4-duplicate-command\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/use-of-p4-duplicate-command\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2012\\\/05\\\/p4-duplicate-command.png\",\"contentUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2012\\\/05\\\/p4-duplicate-command.png\",\"width\":600,\"height\":400,\"caption\":\"p4-duplicate-command\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/use-of-p4-duplicate-command\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Use of p4 duplicate command | P4 Command Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\",\"name\":\"scmgalaxy K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"caption\":\"scmgalaxy K\"},\"sameAs\":[\"http:\\\/\\\/www.DevOpsSchool.com\"],\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/scmgalaxy\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Use of p4 duplicate command | P4 Command Guide - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/","og_locale":"en_US","og_type":"article","og_title":"Use of p4 duplicate command | P4 Command Guide - scmGalaxy","og_description":"Use of p4 duplicate command Problem Area is &#8211; Is there any possibility to rename branch name? as directory rename [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/","og_site_name":"scmGalaxy","article_published_time":"2012-05-16T11:27:22+00:00","article_modified_time":"2021-02-27T09:52:53+00:00","og_image":[{"width":600,"height":400,"url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2012\/05\/p4-duplicate-command.png","type":"image\/png"}],"author":"scmgalaxy K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"scmgalaxy K","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/"},"author":{"name":"scmgalaxy K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"headline":"Use of p4 duplicate command | P4 Command Guide","datePublished":"2012-05-16T11:27:22+00:00","dateModified":"2021-02-27T09:52:53+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/"},"wordCount":177,"commentCount":1,"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2012\/05\/p4-duplicate-command.png","keywords":["command","Copy","Duplicate","Guide","How","p4","p4 clone","p4 commands","p4 commands guide","p4 copy","p4 duplicate command","p4 duplicate tutorial","Perforce","Tutorial","Use"],"articleSection":["Perforce"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/","name":"Use of p4 duplicate command | P4 Command Guide - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/#primaryimage"},"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2012\/05\/p4-duplicate-command.png","datePublished":"2012-05-16T11:27:22+00:00","dateModified":"2021-02-27T09:52:53+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/#primaryimage","url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2012\/05\/p4-duplicate-command.png","contentUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2012\/05\/p4-duplicate-command.png","width":600,"height":400,"caption":"p4-duplicate-command"},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/use-of-p4-duplicate-command\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Use of p4 duplicate command | P4 Command Guide"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102","name":"scmgalaxy K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","caption":"scmgalaxy K"},"sameAs":["http:\/\/www.DevOpsSchool.com"],"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/scmgalaxy\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=319"}],"version-history":[{"count":2,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/319\/revisions"}],"predecessor-version":[{"id":3826,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/319\/revisions\/3826"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media\/3825"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}