DEV Community

Discussion on: Is git the be all and end all of version control?

Collapse
 
jillesvangurp profile image
Jilles van Gurp

The distinction between a different branches and repositories is what makes git so genius. There is none. Just because you call your local branch master and I call my local branch master doesn't mean we are both on the same branch. Rebases and merges work the same when performed against local branches and remote branches. The use of a cryptographic content addressed object store is what makes this work. Syncing is as simple as exchanging read only objects.

So, even though teams don't necessarily use many remotes, they do use loads of branches, which is why they need Git. There are at least n+1 branches where n is the number of people plus whatever feature, production, developmnent, etc. branches people create. On my team that means well over a thousand in the past six months. Some branches are long lived, some are short lived.

Github is just a convenient way to synchronize change. Most teams use it incorrectly by allowing multiple individuals to write to the same repository instead of cloning and creating pull requests.

There is still plenty of room for improvement. Git is not very usable for non experts. A lot of the complexity has to do with dealing with the many ways merges and rebases can fail to work as expected. One limitation here is that a merge commit typically has only two ancestors. Git actually allows for more than two but the porcelain just does not use this. There have been some alternatives where this is used to track changes from multiple branches.

Another area where Git is struggling is larger code bases. The linux kernel is not small but there are examples of big companies where git just isn't good enough for tracking everything they have in one repository. E.g. Google does this (not using git for that). So scale is an issue. Then even though git is distributed, it is not sharded. This imposes upper limits on what can be in a single git repository. The model has always been that you need the entire repository locally to be able to work with it. Wouldn't it be nice if you'd only need a subset of that to be able to work.IPFS copies some of the design for git and stores content addressed objects in a distributed FS. Wouldn't it be nice if somebody rebuilt git on top of that?

So, there's plenty of room for improvement in the Git world.

Collapse
 
pshchelo profile image
Pavlo Shchelokovskyy

Here is an article about changes MS had to do to Git, interesting read

arstechnica.com/information-techno...

Collapse
 
mgasparel profile image
Mike Gasparelli

Unless I'm misunderstanding, Microsoft actually built an implementation to allow working with a subset of files in a repo. They called it Git Virtual File System in case you want to check it out!

Collapse
 
danidee10 profile image
Osaetin Daniel

Well i know it's not Sharding. but if you need a Subset of a git repo you can do a shallow clone.

I find that useful for Repo's that are very large.