DEV Community

Cover image for Stop using Git for Everything
Thomas Hansen
Thomas Hansen

Posted on • Originally published at ainiro.io

Stop using Git for Everything

When you use Git you've got to maintain multiple environments. Even if you simplify it down to its bare minimum, you end up with a development machine being your development environment and a production environment where you deploy.

Having multiple environments implies you've got to create CI/CD pipelines to deploy. This results in more moving parts, and also adds latency to your ability to deliver working code. The more latency you've got the more frustration you accummulate because of having to wait for your systems to deploy. In addition you create distance in time and space between your ability to create code and QA test the same code. The end result is that you move slowly and you create additional risk of deploying buggy code that's not synchronised with your production environment because of having two different environments that might not always be in sync. When you've got two different environments you usually have to:

  1. Maintain two different environments
  2. Synchronise your configurations between your two environments
  3. Synchronise your databases between your two environments
  4. Create and maintain pipelines
  5. Babysit deployments
  6. QA test twice, once in dev and another time in prod
  7. Add unit tests because of the above differences
  8. Etc, etc, etc

In general you reduce your velocity and increase your latency by a factor of 10x by using Git.

You don't always need Git

There's nothing magical about Git that says you always need it. I've got 30 clients I'm working for. Most of my clients have fairly simple code, maybe some 100 to 300 lines of code in total. In addition I've got Magic Cloud which fuses together my development environment and my runtime environment. This allows me to work straight in production and edit the production code directly, without any latency being introduced between me developing new features and production having access to these features. This allows me to:

  1. Use the same database for development and production
  2. Use the same configuration for development and production
  3. Immediately test my code in the prod environment after saving my file
  4. Completely forget about pipelines and CI/CD
  5. Completely drop unit testing
  6. Etc, etc, etc

In general I can increase my velocity by a factor of 10x by dropping Git. To understand the value proposition let me show you how I work, and as you're watching the video try to intelligently answer the question; "What additional benefits would Git provide to me for my process?"

I need to emphasise that I do use Git, but I don't use it for everything. Magic has 8,600 commits for instance, but my client code rarely uses Git. Git is a tool and sometimes we're better out using different tools. This is true for everything in life. And getting stuck in one tool just because everybody else is using it for everything is the very definition of being crazy and delusional.

Git is an amazing tool, and when it came out everybody went crazy about it because of its quality. But just because it's an amazing tool, doesn't imply we should use it for everything - And there's nothing magical about code that tells us it always needs to be versioned. By adding Git to your project you end up with two environments. When you've got two environments you're easily doubling your workload, sometimes quadrupling it.

KISS is the only axiom you should never compromise, and when you follow KISS, you realise that sometimes Git is not needed but in fact counter productive

Top comments (0)