linux:p4
差别
这里会显示出您选择的修订版和当前版本之间的差别。
| 两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 | ||
| linux:p4 [2026/11/06 10:33] – user01 | linux:p4 [2026/11/06 11:05] (当前版本) – [5. p4 add] user01 | ||
|---|---|---|---|
| 行 15: | 行 15: | ||
| mkpwa -s // | mkpwa -s // | ||
| cd 本地目录 | cd 本地目录 | ||
| - | p4 sync | + | |
| + | * 更新全部,p4 sync | ||
| + | * 更新指定文件, p4 sync // | ||
| + | * 更新指定文件指定版本, p4 sync // | ||
| + | * 更新指定目录, p4 sync // | ||
| ``` | ``` | ||
| ### 如果不是stream | ### 如果不是stream | ||
| ```bash | ```bash | ||
| + | mkdir 11111 | ||
| + | cd 11111 | ||
| # 先setenv P4CLIENT xxxx | # 先setenv P4CLIENT xxxx | ||
| 行 26: | 行 32: | ||
| # p4 sync | # p4 sync | ||
| ``` | ``` | ||
| + | |||
| 行 83: | 行 90: | ||
| - | ## - p4 sync | + | ## - 撤销提交 |
| - | 下载,更新. | + | |
| + | 已经进changelist, | ||
| - | ```bash | + | | 需求 | 命令 | 适用场景 | |
| - | * 更新全部,p4 sync | + | | --- | --- | --- | |
| - | * 更新指定文件, p4 sync // | + | | 待提交,扔掉改动 | p4 revert -c CL | 本地没提交,不要了 | |
| - | * 更新指定文件指定版本, p4 sync // | + | | 待提交,先存起来 | p4 shelve -c CL | 临时保存、换机器改 | |
| - | * 更新指定目录, p4 sync // | + | | 已提交,安全回退(推荐) | p4 undo @CL + submit | 主干、多人协作、EDA 项目 | |
| - | ``` | + | |
| - | |||
| - | 一般非stream下载方式 | ||
| - | |||
| - | |||
| - | ```bash | ||
| - | mkdir 11111 | ||
| - | cd 11111 | ||
| - | setenv P4CLIENT xxxxx | ||
| - | p4 client; # then edit the view by yourself | ||
| - | p4 sync | ||
| ``` | ``` | ||
| + | # 撤销指定CL里所有打开文件,变回未checkout | ||
| + | p4 revert -c 12345 //... | ||
| + | # -n 预览,先看会撤销哪些文件,安全优先 | ||
| + | p4 revert -n -c 12345 //... | ||
| + | # 单独revert stream spec | ||
| + | p4 revert -So -c 12345 | ||
| + | # 查看CL内容,确认没有任何条目(无文件、无stream) | ||
| + | p4 opened -c 12345 | ||
| + | # 现在可以删除 | ||
| + | p4 change -d 12345 | ||
| + | ``` | ||
| ## - p4 add | ## - p4 add | ||
| 添加文件到p4 changelist, 然后通过p4 submit命令就可以上传到p4。 | 添加文件到p4 changelist, 然后通过p4 submit命令就可以上传到p4。 | ||
| - | 这个跟git有点类似。 | ||
| 行 118: | 行 123: | ||
| 可以理解是git add命令。 | 可以理解是git add命令。 | ||
| - | ## - p4 revert | ||
| - | 将已经放入p4 changelist,但是还没有p4 submit的文件,回退到修改前的版本。 | ||
| - | |||
| - | |||
| - | ```bash | ||
| - | p4 revert xxxx_file | ||
| - | ``` | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | ```bash | ||
| - | p4 revert //... | ||
| - | |||
| - | Revert every file you have open, in every one of your pending changelists, | ||
| - | |||
| - | p4 revert -c default //... | ||
| - | |||
| - | Revert every file open in the default changelist to its pre-opened state. | ||
| - | |||
| - | p4 revert -n *.txt | ||
| - | |||
| - | Preview a reversion of all open .txt files in the current directory, but don't actually perform the revert. | ||
| - | |||
| - | p4 revert -c 31 *.txt | ||
| - | |||
| - | Revert all .txt files in the current directory that were open in changelist 31. | ||
| - | |||
| - | p4 revert -a | ||
| - | |||
| - | Revert all unchanged files. This command is often used before submitting a changelist. | ||
| - | ``` | ||
| ## - p4 diff | ## - p4 diff | ||
linux/p4.1793932430.txt.gz · 最后更改: 由 user01
