One of the biggest disadvantages of Perforce is that it doesn’t remember the history of your local changes. Track the history of your complex changes… in some way Then I scrupulously keep track of which submitted CL number are my local changes in some shelved CL based on.ģ. Instead of “Get latest revision”, I explicitly specify changelist number to get all files from. Next, I right-click on the directory enclosing entire workspace and select Get Revision. The number can be saved wherever you want - in the description of your shelved changelist or some personal notes in a text file or in Google Docs. To use this method, every time I want to update my workspace, I first go to Submitted tab, clear all the filters, and save the number of the latest changelist I can see there on top of the list. Of course, after the automated build and tests passed, you still need to manually unshelve, update to the latest base, and resolve conflicts. If it is based on the latest submitted code, there would be conflicts and the build would fail. Then, even if the same files changed in their latest submitted version, the build server will pick the right code to apply your shelve and test. Trust me - this will save you and your colleagues a lot of hassle when same files are changed locally and remotely and some conflicts arise.įor example, if you can launch a build on a build server to test automatically your shelved changes, you could have a possibility to specify base submitted CL number next to your shelved CL number. My advice is not to use Get Latest Revision ever, but always know which exact submitted changelist is your workspace at, and so which submitted changelist is the base of your local changes you have in your files currently checked out, or files on your shelved changelists. On top of that, a file can be checked out to have some local changes, which then you save to a shelved changelist. #29), most probably retrieved when updating entire workspace at once using a command like Get Revision or Get Latest Revision. Each file in your workspace is a copy of the file from the repository in some specific version (e.g. Shelved changelists and submitted changelists have very little in common except their name. Remember which submitted change do you base on Selection in Workspace tab will switch to it immediately.Ģ. to check it out, just copy the full path of the file to system clipboard and paste it in this “address bar”. When you work on some file in another tool and you want to jump quickly to it in Perforce, e.g. It shows the path of the currently selected file or directory in Depot or Workspace tab. Perforce window has a text box on the top that resembles address bar in web browsers. Writing them down was difficult as they seem obvious to me, but hopefully some of them are not obvious to you so you will learn something new. While working with Perforce for many years in different companies and projects, I learned some good practices that I would like to share here. there is “Submit” instead of “Commit”), but the whole concept of “changelists” is something that needs to be well understood to be used efficiently. Not only commands are named differently (e.g. I talk about the size of one local copy here, not the entire repository on the server.įrom user’s perspective, Perforce differs greatly from Git or SVN. Even if the files have tens or a hundred of gigabytes, it still works fine. Perforce handles large binary files very well. Whether it is better or worse is hard to tell, but it has its advantages that make it indispensable in some types of projects, like game development. Among them, Git is probably the most popular one. Path = C:\\Program Files\\Perforce\\p4merge.Version Control Systems are tools that every programmer should use. Path = C:\\Program Files\\Perforce\\p4merge.exe Git config -global mergetool.keepBackup false I also added the functionality to automagically clean up my git working directoy after a conflict. $ git config -global 'C:\Program Files\Perforce\p4merge.exe' ASe before you can add the necessary lines to your local. To setup p4merge as visual diff tool, run the next commands in your console. You can also edit your gitconfig file directly. To add p4merge as visual merge tool, run the following commands in your console. You are able to configure p4merge in two ways: using the console or editing the git config file. My recommend way doing this is to use chocolatey installing p4merge like this: choco install p4merge -yĪlternativly you can download and install p4merge by yourself:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |