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.
You can just run: git stash pop. and it will unstash your changes.
Stashing changes is very similar to shelving. The only difference is in the way patches are generated and applied. Stashes are generated by Git, and can be applied from within IntelliJ IDEA, or outside it. Patches with shelved changes are generated by IntelliJ IDEA and are also applied through the IDE.
The git commit and git stash commands are similar in that both take a snapshot of modified files in the git working tree and store that snapshot for future reference. The key differences between the two are as follows: A commit is part of the public git history; a stash is stored locally.
Details: Every documentation, article and book (except Git Internals) says that the git stash is a stack.
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.
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
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