In Perforce on Unix, how do you add a directory that is a symbolic link?

穿精又带淫゛_ 提交于 2020-01-01 04:17:08

问题


I have created a symbolic link directory in Unix and I would like to add it to perforce.

(this question relates to symlinks on Unix. Windows symbolic links can have very different behaviour from Unix.)

  • ../blah/dir1 is the source directory, which contains files that are already in Perforce
  • dir2 is the symlink to the source directory that I want to check in
ln -s ../blah/dir1 dir2

If I right-click on "dir2" in the p4v GUI, it will add every file under ../blah/dir1 as a new file (even if these files are already in Perforce) and fubar everything.

If I do a "p4 add dir2" from the command line, it will add every file under ../blah/dir1 as a new file (even if these files are already in Perforce) and fubar everything.

What is the correct syntax?


回答1:


Add the symbolic link from the shell using the -t option to set the symlink type.

p4 add -t symlink dir2



回答2:


Perforce is able to detect symlinks itself and no special options need to be added in the command. Just regular command like following suffices the need

p4 add <sym link filename> 


来源:https://stackoverflow.com/questions/4923239/in-perforce-on-unix-how-do-you-add-a-directory-that-is-a-symbolic-link

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!