<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nikita Leshenko</title>
    <description>The latest articles on DEV Community by Nikita Leshenko (@nikita).</description>
    <link>https://dev.to/nikita</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F216852%2F5ce6334e-8c37-46d5-aa5f-48822274b25c.png</url>
      <title>DEV Community: Nikita Leshenko</title>
      <link>https://dev.to/nikita</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nikita"/>
    <language>en</language>
    <item>
      <title>μgit - Learn Git Internals by Building Git in Python</title>
      <dc:creator>Nikita Leshenko</dc:creator>
      <pubDate>Sat, 19 Sep 2020 07:05:13 +0000</pubDate>
      <link>https://dev.to/nikita/git-learn-git-internals-by-building-git-in-python-34c5</link>
      <guid>https://dev.to/nikita/git-learn-git-internals-by-building-git-in-python-34c5</guid>
      <description>&lt;p&gt;I'd like to show you an interactive tutorial I've built where we're going to implement Git in Python to learn more about how Git works on the inside.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is not a tutorial on using Git&lt;/strong&gt;! 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.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why learn Git internals?
&lt;/h1&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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 &lt;code&gt;git add&lt;/code&gt;, &lt;code&gt;git commit&lt;/code&gt; and &lt;code&gt;git push&lt;/code&gt; all day long and you'll do fine, as long as you're a sole developer who just commits to one branch.&lt;/p&gt;

&lt;p&gt;But once you start collaborating with multiple people on multiple branches and things like &lt;em&gt;rebase&lt;/em&gt; or &lt;em&gt;force push&lt;/em&gt; are getting involved, it's easy to become lost if you don't have a good mental model of Git internals.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h1&gt;
  
  
  Introducing: μgit
&lt;/h1&gt;

&lt;p&gt;μgit (ugit) is a small implementation of a Git-like version control system (VCS). It's top goal is simplicity and educational value. ugit is implemented in small incremental steps, with each step explained in detail. Hopefully you will be able to read the small steps (explanation and code) and slowly build a complete picture of the internals.&lt;/p&gt;

&lt;p&gt;ugit is not exactly Git, but it shares the important ideas of Git. ugit is way shorter and doesn't implement irrelevant features. For example, to reduce the complexity of ugit, ugit doesn't compress objects, doesn't save the mode of the files or doesn't save the time of a commit. But the important ideas, like commits, branches, the index, merges and remotes are all present and are very similar to Git. If you know ugit well you will be able to recognize the same ideas in Git.&lt;/p&gt;

&lt;p&gt;This tutorial organized as a series of code changes, each change contains an explanation and the diff of the change. For example, you're now reading the first change, and you can see the code that we've added in this change as a diff on the other side. The code is an empty Python application that prints "hello world".&lt;/p&gt;

&lt;h1&gt;
  
  
  Let's begin
&lt;/h1&gt;

&lt;p&gt;The tutorial is an interactive web experience that I've been working on for a long time. Because of the interactivity, I can't just post it here as a blog post. So please visit the tutorial here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.leshenko.net/p/ugit/"&gt;Go to μgit tutorial&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope you enjoy it and I'd be happy to answer any questions!&lt;/p&gt;

</description>
      <category>git</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
  </channel>
</rss>
