Where I work uses a Perforce environment but we are not allowed to check in until our features are completed and ready to be tested. I need to be able to do local commits because at times I have had upwards of 50 files checked out for a week without any versioning on my changes.
Git fits my purpose, but I am not sure how to set it up to best integrate with the rest of my environment.
My goals are:
- When working on a feature I would like to be able to completely ignore Perforce and edit and commit as much as i please (in Git).
- Before submitting a feature, I need to be able to go into P4V or P4Win to diff the files and make sure everything is up to date, and after testing I would like all my changes to be in a single commit.
It seems like creating a git repository at the root directory of my local workspace would work, but I have some issues...
- There are a massive amount of files in this repository and at least with the initial commit git is crawling.
- I need to be able to easily update the git repository when I "get latest" from Perforce
- I don't want to have to deal with checking out every file in Perforce before I edit it, nor do I want to have to do a Force Sync in Perforce because their are writable files that aren't checked out.
Can anyone give me some tips about this? I've been looking at submodules in git as a way to potentially reduce the size of the git repo as there are a lot of portions of the perforce repo that I don't need versioning on.
Here's a crude solution. After you sync from
p4
, Do agit init
in that directory, add all the files and commit them. Do your work completely ignoring git and then add and commit them back intop4
.This and some related things were discussion in this question.