Reputation: 4557
I've dug through the interwebs all I can, and I can't for the lack of me find any way of easily stashing or branching locally with perforce. I know of the git wrapper for perforce, but it really doesn't seem too well developed or reliable from everything I've read about it.
Upvotes: 16
Views: 12622
Reputation: 1324268
Regarding branching, I doubt you can "branch" locally in Perforce, nor could you natively stash.
Regarding branching:
p4 branch
" command - also a noun) - these are talked about belowp4 integrate
" command to create a new codeline (or branch!) of one or more filesAs mentioned in this introduction to perforce branching, Perforce, being heavily linked to its central depo, need to create the relevant metadata for each files to create a branch.
Git would only write some bits to register the creation of a new branch!
[*] git branches are stored in the .git/refs/heads/
subdirectory
Upvotes: 3
Reputation: 2589
A future version of Perforce will have private local branching. P4Sandbox will allow you to have a local, disconnected subset of the depot. You can pull from the central server, do whatever you want in your sandbox (including branching and integrating) and then, if you wish, push back to the central server.
Shelving is the closest equivalent of git stash, as explained in Douglas Leeder's answer.
(Although it initially appeared that P4Sandbox would make its debut in version 2011.1, the 2011.1 beta does not have the feature, nor can I find any mention of it in the documentation for that version. As of August 2011, the P4Sandbox beta was slated for "this fall".)
Upvotes: 2
Reputation: 53310
Perforce 2009.2 has shelve and unshelve, that let you put modifications on the server, without checking them in. http://blog.perforce.com/blog/?p=1872
I think that provides the sort of functionality you want?
If you aren't yet using 2009.2, there are also P4_Shelve and p4tar as possible alternatives.
Upvotes: 37