I am new to p4, so some explanations will be much appreciated and more helpful than the answer itself.
I want to edit a file foo.txt. I am in the directory where this file lives.
My attempts to edit foo.txt have been the following:
$p4 sync
File(s) up-to-date.
$p4 edit foo.txt
foo.txt - files(s) not on client
$p4 add foo.txt
//depot/directory/foo.txt#1 - opened for add
$p4 edit foo.txt
//depot/directory/foo.txt#1 - can't edit (already opened for add)
The fact that there isn't much info on this when Googling this issue indicates that it's probably trivial.
If a file does not exist in perforce, you cannot edit it. If a file is currently opened for add, you don't need to edit it. When you submit the change that contains the add, the contents of the file at that time are used. Once you have submitted the change adding the file, any time you want to subsequently modify the file, you would do p4 edit foo.txt
to add it to a changelist, make changes, and then submit that change.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With