Perforce 2008.1 Command Reference | ||
<< Previous Chapter About This Manual |
Table of Contents Index Perforce on the Web |
Next Chapter >> p4 admin |
To open a file with p4 add, the file must exist in your client workspace view, but does not need to exist in your workspace at the time of p4 add. The file must, however, exist in your workspace when you run p4 submit, or the submission will fail. p4 add does not create or overwrite files in your workspace; if a file does not exist, you must create it yourself.
By default, the specified files are linked to the default changelist. Use -c to specify a different changelist.
When adding files, Perforce first examines the typemap table (p4 typemap) to see if the system administrator has defined a file type for the file(s) being added. If a match is found, the file's type is set as defined in the typemap table. If a match is not found, Perforce examines the first 8192 bytes of the file to determine whether it is text or binary, and the files are stored in the depot accordingly. Text file revisions are stored in reverse delta format; binary file revisions are stored as full files.
To explicitly specify a file type, overriding both the typemap table and Perforce's default file type detection mechanism, use the -t filetype flag.
To add files containing the characters @, #, *, and %, use the -f flag. This flag forces literal interpretation of characters otherwise used by Perforce as wildcards.
-c changelist |
Opens the files for add within the specified changelist. If this flag is not used, the files are linked to the default changelist. |
-t filetype |
Adds the file as the specified filetype. Please see the File Types chapter for a list of Perforce file types. |
-f |
Use the -f flag to force inclusion of wildcards in filenames. See the File Specifications chapter for details. |
-n |
Preview which files would be opened for add, without actually changing any files or metadata. |
See the Global Options section. |
p4 add -t binary file.pdf |
Assigns a specific file type to a new file, overriding any settings in the typemap table |
p4 add -c 13 * |
Opens all the files within the user's current directory for add, and links these files to changelist 13. |
p4 add README ~/src/*.c |
Opens all *.c files in the user's ~/src directory for add; also opens the README file in the user's current working directory for add. These files are linked to the default changelist. |
p4 add -f *.c |
Opens a file named *.c for add. To refer to this file in views, or with other Perforce commands, you must subsequently use the hex expansion %2A in place of the asterisk. For more information, see "Limitations on characters in filenames and entities" on page 254. |
To open a file for edit | |
To open a file for deletion | |
To copy all open files to the depot | |
To read files from the depot into the client workspace | |
To create or edit a new changelist | |
To list all opened files | |
To revert a file to its unopened state | |
To move an open file to a different pending changelist | |
To change an open file's file type |
p4 reopen -t filetype |
Perforce 2008.1 Command Reference | ||
<< Previous Chapter About This Manual |
Table of Contents Index Perforce on the Web |
Next Chapter >> p4 admin |