p4 常见问题

p4 常见问题:

p4 login,需要输入密码
p4 -p YOUR_P4PORT login -a
 
查看p4 login的状态,ticket是否过期
p4 -p YOUR_P4PORT login -s
 
client spec中的选项的意义
[no]allwrite Will all files be synced as read-only, or writable? 
[no]clobber Should a sync command overwrite any writable, unopened files? 
[no]compress Will data sent between client workspace and server be compressed? 
[un]locked Will other user be able to use/edit your client spec? 
[no]modtime Will files be timestamped with sync or submit time? 
[no]rmdir Should a sync command delete empty directories? 
 
Edit your client spec and remove the "Host" field to allow it to be used on any host.
 
How do I exclude a directory/file when syncing? 
Update your client spec to put a "-" (minus) on the directory/file you want to exclude.
 
 
How do I move files between changelists? 
Use 'p4 reopen'. For example, to move files from default to another changelist, 
% p4 reopen -c <changelist> <file>
 
How do I delete a pending changelist in a non-existent client? 
Use 'p4 -c <client>' even though the client no longer exists.
% p4 -c <client> change -d <changelist>
 
 
The directory I'm in is symbolically linked to another. P4 reports "file(s) not on client" when I run the command. How do I tell it to follow the link? 
Use the -d option.
% p4 -d `/bin/pwd`
 
The file I'm working on is symbolically linked to another file. When I do a 'p4 edit', I check out the link instead of the file that it links to. How do I tell it to follow the link? 
If you intend to update the file's content, you will have to check out the actual file the link points to. Check out the link only when you intend to remove the link, or update what it is pointing to.
 
How do I add the entire directory tree? 
Directories are added automatically along with the files underneath them. You can run a UNIX 'find' command to list all files and links. Note that empty directories cannot be added. 
 
% find . ! -type d | p4 -x - add
 
 
How do I compare my working file with the depot copy? 
To see your modification, 
 
% p4 diff <file>#<revision>
The file is only compared with the depot if it is opened for edit, or the specified revision is not the same as the revision last synced to your workspace. 
 
 
How do I compare two depot revisions? 
To compare two revisions in the depot, 
 
% p4 diff2 <file1> <file2>
 
 
How do I change the file type? 
If you do not have the file opened in your workspace, 
 
% p4 edit -t <new_type> <file>
If you already have the file opened, 
% p4 reopen -t <new_type> <file>
and submit after that.
 
 
How can I find out which of the files I have edited need to be resolved with a recent submitted version? 
Sync to the latest revision to trigger the server to recognize what files you have edited that require a merge. The "-n" option lists the merges which would be performed without actually doing them. 
 
For example, 
 
% p4 sync
...
//sde/scripts/main/src/create_linkbr#12 - is opened and not being changed
... //sde/scripts/main/src/create_linkbr - must resolve #12 before submitting
...
% p4 resolve -n
/remote/ped57/bella/sde/scripts/create_linkbr - merging //sde/scripts/main/src/create_linkbr#12
 
查看文件是否在p4上: p4 have file
查看文件的最近的修改历史: p4 filelog file | less
posted @ 2013-04-08 22:14  iTech  阅读(2030)  评论(0编辑  收藏  举报