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.
I do the same thing at work with StarTeam and git. I'm not familiar with perforce syntax, but the concepts should match.
First of all, the initial git commit is always slow. After that, it might take 5-10 seconds to scan changed files for staging, but the commit should happen nearly instantaneously most of the time. For context, our code base has approximately 50,000 versioned files.
I keep
mastersynced up with StarTeam, but don't do any development work directly in it. I do agit checkout master, then do a StarTeam update, then a git add and commit.Then for my work, I make a new branch, do all my work in there, do another StarTeam update in
master, and merge my feature branch back intomasterbefore committing to StarTeam. Thus, StarTeam check ins and outs are all done inmaster, and development is always done in other branches, which keeps the StarTeam updates clean.This mixed approach has some other nice benefits, like being able to put partial work on hold for a while for code reviews, field issues, or whatever. I currently have 5 git branches in various states of use. It's also real nice for putting in temporary debugging code.