環境變量:
export P4PASSWD=abcdefg
export P4CLIENT=dyoldfish.com //這個可以不設
export P4USER=dyoldfish
export P4PORT=192.168.1.198:1666
指令:
1、p4 client #配置本地資訊,檔案下載下傳在哪裡在這裡面配置,Root項
2、p4 sync #從perforce 下載下傳檔案
3、p4 login #登陸perforce
4、p4 help #顯示關于指令的幫助
5、p4 -h #顯示關于p4的幫助
6、 p4 labels ... #顯示和這個目錄相關的标簽
7、p4 sync @dyoldfish_label #同步标簽dyoldfish_label中的所有檔案
8、p4 files @dyoldfish_label #檢視标簽dyoldfish_label所包含的檔案清單
9、p4 revert #回複所有打開的檔案
10、p4 revert -n ... #回複所有打開卻沒送出的檔案
11、p4 branch dyoldfish_brach #建立分支
12、p4 integrate -b dyoldfish_brach #合并分支dyoldfish_brach中描述的檔案
13、p4 opened #檢視打開的檔案
14、p4 help commands #檢視p4所有指令的幫助
15、4 dirs -H . #顯示目前目錄
16、p4 branches #顯示所有的分支
17、 p4 delete filename #從p4删除檔案
18、p4 changelists -L ... #顯示目前目錄下面所有檔案的修改注釋
19、p4 label dyoldfish_label #建立标簽 dyoldfish_label,編輯标簽
20、p4 tag -l dyoldfish_label ... #把目前目錄下面的所有檔案添加到标簽 dyoldfish_label
21、p4 changes ... #目前目錄的changelist
22、 p4 sync @10931 #sync file @changelist
23、 p4 sync [email protected]
#only sync [email protected]
24、p4 help revisions #檢視關于檔案範圍的幫助
export好變量之後,然後用1進行配置,就可以用p4 sync進行代碼下載下傳了 如p4 sync //depot/proj1/[email protected]
更詳細的指令格式參考 http://www.perforce.com/perforce/products/p4.html
p4用戶端下載下傳 http://www.perforce.com/perforce/downloads/index.html
本文轉自http://blog.csdn.net/dyoldfish/archive/2007/08/28/1761940.aspx