Question

find . -type f -print | p4 -x - add

This adds all files from $PWD and its sub directories, but it prints the message can't add existing file for files already in perforce.

How do I add only new files which are not in P4?

Was it helpful?

Solution

For Perforce versions 12.1 and above, you can use the command p4 reconcile, which will reconcile any added, deleted, or edited files outside of Perforce. To use it specifically to add files, type p4 reconcile -a.

Just a note though, it doesn't do any harm to do the command you are doing. It issues a warning for any files already existing, but that's it. It will still add the files that don't currently exist in Perforce. Your command is the way I have done it until the p4 reconcile command was created.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top