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.