{"id":1525,"date":"2016-10-30T15:03:53","date_gmt":"2016-10-30T20:03:53","guid":{"rendered":"http:\/\/www.jaimerios.com\/?p=1525"},"modified":"2016-10-30T15:03:53","modified_gmt":"2016-10-30T20:03:53","slug":"creating-a-remote-from-an-already-existing-depo","status":"publish","type":"post","link":"https:\/\/jaimerios.com\/?p=1525","title":{"rendered":"Creating a remote from an already existing depo"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2015\/12\/perforcelogo.png\" alt=\"\" width=\"234\" height=\"27\" class=\"alignleft size-full wp-image-1503\" \/><\/p>\n<p>Today, I created a remote depo, so that I can use the DVCS functionality in P4 with one of my projects.<\/p>\n<p\/>\nFirst, I connected to my perforce server and typed:<\/p>\n<p\/>\n$p4 remotes<\/p>\n<p\/>\nTo see all of the remotes that were on the server. Before doing this command you have to type:<\/p>\n<p\/>\n$p4 login<\/p>\n<p\/>\nWhich thankfully, my username on the linux server is the same as my username in the Perforce server so I didn&#8217;t have to type that again.<\/p>\n<p\/>\nOnce I was logged in and saw that there was no remote set up for the project I wanted to use with DVCS, I typed:<\/p>\n<p\/>\n$p4 remote PROJECT_CODE_NAME<\/p>\n<p\/>\nThis brought up NANO (I know some of you out there are rolling your eyes) and I modified the \/\/local\/&#8230; \/\/remote\/&#8230; paths to my liking. Remember, the left side represents the local depo representation on your computer and the right side of that mapping is the remote depo representation that is on your Perforce server.<\/p>\n<p\/>\nNow, in another terminal, I typed:<\/p>\n<p\/>\n$cd PATH_WHERE_YOU_HAVE_YOUR_DEVELOPMENT_WORK<br \/>\n$mkdir PROJECT_CODE_NAME<br \/>\n$cd PROJECT_CODE_NAME<br \/>\n$p4 -u jaimerios clone -p 192.168.1.10:1666 -r PROJECT_CODE_NAME<\/p>\n<p\/>\nThe last command then takes the files specified in the mapping and clones it to your local filesystem.<\/p>\n<p\/>\nYou can check that the origin server is set up by typing:<\/p>\n<p\/>\n$p4 remote -o origin<\/p>\n<p\/>\nNow, in my project, I had two read-only depos in my Perforce server that was for the Boost headers and the Google gtest framework libs.<\/p>\n<p\/>\nFor those normally import+ folders, I created a symbolic link to those folders that were already on my local filesystem:<\/p>\n<p\/>\n$cd PROJECT_CODE_NAME\/libs<br \/>\n$ln -s \/Users\/jaimerios\/Development\/Perforce\/READONLY\/libs\/Boost .\/Boost<br \/>\n$ln -s \/Users\/jaimerios\/Development\/Perforce\/READONLY\/libs\/Google .\/Google<\/p>\n<p\/>\nAnd so far, everything seems to work well &#8230; except there are a few files I want p4 status to ignore, so:<\/p>\n<p\/>\n$cd PROJECT_CODE_NAME<br \/>\n$nano .p4ignore<\/p>\n<p\/>\nI added some folders and files to ignore and life is good.<\/p>\n<p\/>\nSo, onto happy coding \ud83d\ude42 <\/p>\n<p\/>\n","protected":false},"excerpt":{"rendered":"<p>Today, I created a remote depo, so that I can use the DVCS functionality in P4 with one of my projects. First, I connected to my perforce server and typed: $p4 remotes To see all of the remotes that were on the server. Before doing this command you have to type: $p4 login Which thankfully, &#8230; <a title=\"Creating a remote from an already existing depo\" class=\"read-more\" href=\"https:\/\/jaimerios.com\/?p=1525\" aria-label=\"Read more about Creating a remote from an already existing depo\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,7],"tags":[178,340,349],"class_list":["post-1525","post","type-post","status-publish","format-standard","hentry","category-coding","category-devops","tag-dvcs","tag-p4","tag-perforce"],"_links":{"self":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts\/1525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1525"}],"version-history":[{"count":0,"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts\/1525\/revisions"}],"wp:attachment":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}