Perforce - How to get the list of files that have been modified locally?
Asked Answered
E

5

29

I am looking for a perforce command to get the list of the files that have been modified locally and "not" checked-in to the repository.

I understand that I "should" get the list of modified files in Pending changelist, but there are scenarios when I don't get to see a modified file in that list. And then on "manually" checking out a file and doing a diff i realize the difference.

Is there any command that could check all the files in a given folder and provide me a list of files that are not same as there state in the repository?

I tried "p4 sync", but that did not work.

Thanks for your interest.

Endoparasite answered 12/9, 2011 at 10:41 Comment(2)
Don't edit files without adding them to a changelist and this (and other) problems won't happen.Glary
That's sometimes not an option: assume the lost of connection with the server.Fir
F
48

Try

p4 diff -f -sa

(see manual for further details)

Fleeting answered 12/9, 2011 at 10:51 Comment(6)
Very helpful. In general, all I needed to see was that it was associated with "diff" and that was enough to find it in p4v as well.Quinones
Thanks [+10]. is there a way to make it faster to execute this command? equivalent of git [git status -s .] was supper fast than this.Balderdash
@chandpriyankara: git status doesn't compare against the remote server - git diff origin/branchname would be more equivalent...Fleeting
I get an error Files(s) not on client. How to resolve it? I have set the client.Garaway
@Garaway I would suggest asking a separate questionFleeting
Well the error came while executing this command. Anyway I have resolved it. Was setting a wrong client name.Garaway
W
7

I use "p4 revert -n ./..."

where

-n

List the files that would be reverted without actually performing the revert.

This lets you make sure the revert does what you think it does before actually reverting the files.

Warfare answered 30/4, 2014 at 21:31 Comment(1)
This sounds potentially very dangerous O.OHowarth
C
4

In the recent versions of Perforce, try "p4 reconcile -e"

see: http://www.perforce.com/perforce/r12.1/manuals/cmdref/reconcile.html

It certainly takes its time though (not very fast).

Conjunction answered 27/5, 2013 at 18:13 Comment(2)
I'd recommend not to run that without thinking twice, as it also adds untracked files.Russian
To list the status, without actually opening files for add/edit/delete, specify 'reconcile -n' or use 'p4 status'Shoup
A
0

I think, the modified files are submitted locallay (Otherwise, p4 opened ./... will help to find)

If files are already submitted to local perforce and still want to know which all are modified..

  1. p4 changes -m 5 ./... (Should give changes lists)
  2. p4 integrate -n ./... //server/code/base/... (This should list the files to be integrated to mainline.
Amathist answered 14/5, 2014 at 2:43 Comment(0)
E
0

I am new to Perforce, but below command works for this situation p4 status This shows all files that are not part of repository but present in depot

Electrophone answered 19/6, 2023 at 5:53 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Pyrometer

© 2022 - 2025 — McMap. All rights reserved.