Learn #git by building one in #python!
> This tutorial is different from most Git internals tutorials because we're not going to talk about Git only with words but also with code! We're going to write in Python as we go.
> This is not a tutorial on using Git! To follow along I advise that you have working knowledge of Git. If you're a newcomer to Git, this tutorial is probably not the best place to start your Git journey. I suggest coming back here after you've used Git a bit and you're comfortable with making commits, branching, merging, pushing and pulling.
> Why learn Git internals?
> For most tools that we use daily, we don't really care about their internals. We can use Firefox or Vim without understanding their inner workings.
> At first you shouldn't care about Git internals either. You can use Git as a set of CLI commands that track code history. Run git add, git commit and git push all day long and you'll do fine, as long as you're a sole developer who just commits to one branch.
> But once you start collaborating with multiple people on multiple branches and things like rebase or force push are getting involved, it's easy to become lost if you don't have a good mental model of Git internals.
> From my experience with using Git myself and teaching others, a better way to improve your effectiveness with Git is by understanding how it works behind the scenes and not by learning more "advanced" Git commands. This understanding is what will allow you to solve the kind of problems that multi-user collaborative coding sometimes produce.
> Why not learn Git by reading the real Git code?
> The real Git code is too complicated to be useful for learning basic concepts with ease. It is production quality code that is optimized for speed. It is written in C. It implements so many advanced Git features. It deals with a lot of edge cases that we don't care about for learning. In this tutorial we will focus on the bare minimum to get the point across.
https://www.leshenko.net/p/ugit
Post #688
2.88K