GitP4Sync - a GitHub to Perforce sync framework

GitP4Sync - a GitHub to Perforce sync framework

The flexibility offered by git is unrivaled! as a developer it's very hard to go back once you're on the git wagon; while being completely disconnected makes it ideal for remote working, unlocking productivity during crisis times.

It's quite common to have people migrating from other source control systems to git, while the change is often painful and risky, it's well worth it.

In this article, we'll talk about a less risky approach to perform a Perforce to Git migration, something that would allow you to test the waters in real life and onboard people slowly instead of a doing lift and shift.

Typically, migration involves:

  • Culture/skillset gap; while git is beautiful, it does have a learning curve which typically requires training followed by active practice.
  • CICD, pipelines will need to be rewired to git, depending on their setup, migrating will take time and effort.
  • Issues specific to the codebase, how would the developer experience be impacted with git, which files better suited for LFS, etc.. which can be answered by actually using the migrated code base.

While lift and shift remains the recommended approach when feasible, I've seen it first hand where migrations comes to a halt due to the sheer complexity and the number of things that needs to be finalized before it can take place.

So, what if you could do the migration progressively? won't that be great!

What if you can allow developers to use either Perforce or GitHub and once everything is ready, you simply pull the plug on Perforce and GitHub becomes the source of truth.

I hear you saying, Nah, not interested to have someone sitting there just to merge and resolve conflicts; and I completely agree, if you go down that path you've a very slim chance of success, and a huge risk of two diverged sources.

But, that's not what I'm talking about; I'm talking about something that works seamlessly without merges, conflicts or any of that, something that just works!

The idea is quite simple, during the transition period Perforce users aren't impacted, to them everything remains the same; while GitHub becomes a proxy to Perforce where changes are never committed directly to git, instead they're applied to Perforce.

  1. There's a one way sync from Perforce to Git; no one is allowed to commit to GitHub directly.
  2. Developers use the standard git workflow, branch, push, and create a pull request.
  3. When the pull request is ready, the changes are applied automatically to Perforce instead of being committed to Git
  4. Changes are then synced back to Git by the one way sync flow.

This becomes possible because of GitP4Sync, an open source sync solution that treats the GitHub repository as a proxy to Perforce, so in effect developers never commit to git, but to Perforce; which gives you:

  • A chance to onboard developers slowly on their own pace, without incurring productivity loss.
  • Early reaping the benefits of GitHub features, i.e. code reviews, gated check-ins, etc..
  • Migrating the pipelines one by one against a real GitHub repository, and experimenting until you’re happy with the results.
  • Mitigating the risk of things going wrong, which could lead to development downtime, and potentially rework in case of a need to rollback.

GitP4Sync is targeted towards long running Perforce to Git migrations, and organizations that would like to offer developers a choice of using git with Perforce without spending a lot of money on proprietary software or expensive licenses.

All the best in your migration journey!

This is amazing work, Mahmoud. Your knowledge of GIt & Perforce is very deep and has allowed you to develop a solution that will allow a large organisation to eventually transition from Perforce to GitHub. All in your spare time! Your passion shines through.

This is amazing Mahmoud! Very good job 👏🏼

To view or add a comment, sign in

More articles by Mahmoud Hanafy

  • Migrating a Perforce repository to Git

    Changing source control systems can be challenging, especially when dealing with large repositories, loads of history…

    1 Comment
  • Handling large Git repositories

    Git is a powerful and very flexible source control system that quickly became the industry standard mainly due to:…

  • PipeVision - Your CICD pipeline companion

    CICD Pipelines are amazing in enabling agile development, making continuous deployment possible. As software projects…

    8 Comments
  • Entity Framework Bulk Processing

    EF is a very impressive tooling for DB access, that's commonly used in .Net development; It makes working with data a…

Others also viewed

Explore content categories