Add a file to existing changelist
33,280
Solution 1
In general you can use:
p4 reopen -c CLN FILE ...
to move open files into the specified changelist (regardless of whether they were open for edit, add, etc.).
CLN
may be default
to dissociate the specified files from any numbered changelist.
Solution 2
You can say:
p4 edit -c changelist# file ...
where changelist#
refers to the pending changelist.
Related videos on Youtube
Author by
Aman Deep Gautam
Software developer at Amazon India. Graduated form IIT Hyderabad in 2013 with honors in Computer Science.
Updated on August 17, 2022Comments
-
Aman Deep Gautam almost 2 years
I edited few files in my workspace and did
p4 change
. Then I remembered that I have to make some more edits to additional files(not in the changelist). I opened those files withp4 edit
but how to add these files to existing changelist. Is there a way to do it?-
devnull over 10 yearsSince you use the command line, I'd be tempted to say that you
p4 help command
would show the help for the specifiedcommand
right away.
-
-
Daryl Spitzer about 9 yearsWhen I tried this I got: "can't change from default change - use 'reopen'"
-
Aman Deep Gautam over 8 years@DarylSpitzer I have not used p4 in a long time but changing the accepted answer as per upvotes and your comment. I am sure at that time it worked for me.
-
jamesdlin about 8 years@AmanDeepGautam FYI, this answer works but only for files that are open for edit. It won't work for files that were open for other actions.
-
ashleedawg over 6 yearsAre you able to provide more information about this answer?
-
Samwise over 6 yearsThis works when opening the file for edit (same as @devnull's answer), and most other commands that open the file will accept a similar
-c change
option. If you have already opened the file (for any arbitrary action) and want to put it in a different changelist after the fact you want to use thereopen
command. -
Alok Prasad almost 4 yearsHow moveout the file from Changelist
-
jamesdlin almost 4 years@AlokPrasad You can use
p4 reopen -c default FILE ...
to move the specified files out of a specific changelist and into the default, unnamed changelist. I've updated my answer to mention that. -
Enlico over 2 yearsMaybe
p4
has changed since this answer was given, but I getfile(s) not opened on this client
when a file was not open.p4 open
instead ofp4 reopen
works though. -
jamesdlin over 2 years@Enlico Correct, you would need to use
p4 open
/p4 edit
for files not already open. As I stated, you would usep4 reopen
to move open files into the specified changelist, which is the scenario described by the original question. -
Enlico over 2 years@jamesdlin, oh, ok I had over-generalised your regardless of whether they were open for edit, add, etc. I thought it included also the not open at all case.