๊ฐ•์˜

๋ฉ˜ํ† ๋ง

๋กœ๋“œ๋งต

How Git Works by Julia Evans

You use Git every day, but are there still times when it scares you? When a `git push` is rejected, when a colleague says, "Please rebase and upload," or when that "detached HEAD state" message pops up. Youโ€™ve probably had at least one moment where your mind went blank, and you ended up deleting the entire folder just to clone it again. This course is for people like you. Julia Evans' ใ€ˆHow Git Worksใ€‰, beloved by developers worldwide, is finally available in Korean. This isn't a course about memorizing commands. Itโ€™s a course where we take a slow, deep look at how Git actually works under the hood. Whatโ€™s inside the `.git` folder, How branches are actually stored, Where "orphaned" commits go and how to recover them, And what "up to date with origin/main" actually means. It consists of 27 pages across 6 chapters: โ˜… Commits โ˜… Branches โ˜… Exploring the .git folder โ˜… Merging โ˜… Remote repositories โ˜… Surviving disasters Once you properly grasp the internal model, you'll be able to interpret any message Git throws at you on your own. Instead of memorizing commands, you'll start using it while understanding "why it works this way." Iโ€™ll share the promise Julia made on the first page of her zine: "Once you understand the internals, you can get yourself out of any Git mess."

46 learners are taking this course

Level Basic

Course period Unlimited

Git
Git
GitHub
GitHub
Version Control System
Version Control System
Team Collaboration Tool
Team Collaboration Tool
git-commands
git-commands
Git
Git
GitHub
GitHub
Version Control System
Version Control System
Team Collaboration Tool
Team Collaboration Tool
git-commands
git-commands
0xbf5๋‹˜์˜ ํ”„๋กœํ•„ ์ด๋ฏธ์ง€

๏ฝฅ

Edited

A short greeting from Julia Evans for Korean readers

" Hello!

I am so happy that the Korean translation of ใ€ŠHow Git Worksใ€‹ has been published. Although I cannot read Korean, looking at the design and quality of the translation, I felt that it was made truly beautifully.

I hope this little zine helps you understand and use Git with more confidence.

Enjoy reading! "

โ€” Julia Evans

ย 

Hello. We are BFS (Byte Freaks Studio). ๐ŸŽฒ
After reading Julia's greeting, you might have a question.

ย 

Why did Julia decide to create this zine?

Git is a tool used daily by countless developers around the world, but at the same time, it is also the tool that many people find most difficult. Julia also focused on that point, and those reflections eventually led to the creation of ใ€ŠHow Git Worksใ€‹.

The following text is a blog post written by Julia herself at the time of the publication of ใ€ŠHow Git Worksใ€‹. I am introducing it in Korean as I believe it is a piece that allows for a deeper understanding of the core problems this zine aimed to address and what it intended to convey.

Please enjoy reading. ๐ŸŽฒ


Hello!

It feels like I've been talking about nothing but Git on this blog for months. Finally, the Git Zine is complete! It was published last Friday.

ย 

Who is this zine for?

I wrote this zine for people who have been using Git for years but are still afraid of it. I always think the same thing: it really sucks to have to be afraid of a tool you use every day for work! I want people to be able to use Git with confidence.

ย 

The goal of this zine is as follows:

  • Explain that Git concepts which may feel scary at first (for example, the "detached HEAD state") are actually quite simple once you understand what is really happening.

  • Point out specific areas in Git where you need to be especially careful. For example, stash is one of the features where it's easiest to lose your work, and once a problem occurs, recovery is extremely cumbersome. That's why I tend not to use stash very often.

  • Correcting widespread misconceptions about core Git concepts such as commit, branch, and merge

ย 

Why on earth is Git so confusing?

Writing this zine was much harder than I expected. When I started writing, I had already been using Git quite confidently for 10 years. As a result, I could hardly remember what it was like back when I used to struggle with Git.

ย 

But thanks to Marie and the many people on Mastodon who shared their thoughts on Git, I eventually came to see once again that there are so many parts of Git that are unintuitive, misleading, or just plain confusing.

ย 

For example, things like these.

  • Confusing terms (expressions like "fast-forward", "reference", "remote-tracking branch")

  • Misleading messages (for example, the message Your branch is up to date with 'origin/main' does not necessarily mean it is actually synchronized with the main branch of the remote repository)

  • Output results that do not provide sufficient information (for example, even now, when I look at merge conflicts, there are times when I cannot immediately tell which code came from which branch)

  • Insufficient guidance regarding diverged branches (for example, when you run git pull and the local and remote branches have diverged, Git does not explain very kindly how to handle this situation)

  • Inconsistent behaviors (for example, while the reflog almost always operates in an append-only manner, the stash is an exception; running git stash drop actually deletes the existing entry)

The more I hear about how confused people feel about Git, the clearer it becomes that Git is a tool whose internal logic is not easily understood simply by trying it out.

ย 

You eventually get used to Git's quirks

Reading this far, Git might sound like a truly terrible tool. You might even wonder, "Who on earth would use something like this?"

ย 

However, my experience is a bit different. Once I understood what those strange error messages Git spits out actually mean, most situations became quite routine.

ย 

For example, let's say you encountered the following error.

failed to push some refs to 'github.com/wizard-zines-site'

Then I think, "Ah, someone must have pushed changes to the main branch since I last did a git pull." Then I run git pull --rebase to bring in the changes and continue with what I was doing. It usually takes about 10 seconds.

ย 

Or you might see a warning like this.

You are in 'detached HEAD' state

In that case, you can simply run git checkout mybranch before you continue writing your code. It's not a big deal.

For me, and for many people I talk to about Git, its peculiar expressions have become so familiar that we sometimes even forget why someone would find them difficult in the first place.

ย 

How deep should we go into Git's internal structure?

One of the things I agonized over most while writing this Zine was how much of the inside of the .git directory I should explain.

In the end, we decided to include a page covering Git's internal structure ("Exploring the .git folder"), but overall, we chose to focus more on the behaviors you actually see when using Git and the reasons why Git sometimes acts unexpectedly.

There are two reasons for this.

One is because there are already many excellent resources available that explain Git's internal structure.

And the other reason is that I felt that even after reading such materials, it is not as easy as one might think to understand how they connect to the actual phenomena seen in the Git user interface.

For example, explanations regarding Git's remote repositories are easy to find. Some documents explain it as follows:

Remote-tracking branches [...] remind you where the branches in your remote repositories were the last time you connected to them.

But even after reading this explanation, the following message displayed in git status

Your branch is up to date with 'origin/main'

it does not necessarily mean you will naturally understand that it isn't completely synchronized with the main branch of the remote repository.

So, in this zine, rather than explaining Git's internal structure first, I focused on the behaviors you actually encounter while using Git and aimed to explain the principles of how those behaviors work internally.

ย 

Actually, I really like Git

In this article, I have shared quite a few critical stories about Git. However, I only write zines about the technologies I love. Git is no exception.

There are many reasons why I like Git.

  • It's fast!

  • Backward compatibility is excellent. The Git knowledge I learned 10 years ago is still almost entirely valid today.

  • There are so many great Git hosting services available for free. (GitHub! GitLab! and many others!) Thanks to them, I can easily back up my code.

  • Simple workflows are truly simple. When working on a project alone, repeating just git commit -am 'whatever' and git push works perfectly fine most of the time.

  • Most of Git's internal files are fairly simple text files. (Or there are versions that can be viewed in text format.) So it gives you the feeling that you can understand what's going on inside at any time if needed.

I hope this zine helps you come to love Git at least a little bit.

ย 

People who helped create this Zine

I don't make these zines alone!

I worked with Marie Claire LeBlanc Flanagan every morning for eight months, thinking about how to explain Git more clearly. Vladimir Kaลกikoviฤ‡ worked on the cover, and Gersande La Flรจche handled the proofreading. James Coglan, the author of ใ€ŠBuilding Gitใ€‹, provided the technical review, and Lee, the operations manager, helped with text transcription as well as countless other tasks. My partner Kamal, as always, read the drafts and pointed out awkward parts, and I also had many great conversations about Git with Marco Rogers.

Finally, I would like to express my gratitude to the beta readers. This time, a whopping 66 beta readers participated, which was the largest number ever! They left hundreds of comments on what was confusing, what they learned for the first time, and which of my jokes were actually funny.

It is never easy to hear that a page I thought I had explained clearly was actually very confusing. However, because I was able to discover and fix those issues before the final publication, this zine could become a much better final product.


Thank you

As always, I would like to express my sincere gratitude to everyone who has purchased my zines over the years. I was able to come this far thanks to your constant support.

And thank you to the more than 1,000 people who purchased this zine in just 3 days after its release!!!

Thanks to you, this zine set a record for the most copies sold in a single day in Wizard Zines history. Itโ€™s truly amazing, and I am deeply moved.


BFS(Byte Freaks Studio)

Did you enjoy reading Julia's post?

The most impressive part of this piece was that Julia didn't stop at simply criticizing the inconveniences of Git. Git is difficult. Sometimes it's strange, some messages are hard to understand, and certain behaviors are unintuitive. However, Julia asked the question, "Why is Git like this?" and then proceeded to step-by-step analyze and explain the reasons why Git is so difficult to understand.

ย 

Another thing that was impressive was the perspective on Git learning materials.

ย 

There are already many excellent resources available that explain the internal structure of Git. However, even after reading such materials, many people are often left wondering, "So why is Git behaving like this right now?" when they actually start using it in the terminal.

ย 

There is a larger gap than one might think between Git's internal principles and the user interface that actual users encounter. Many of you have likely had a similar experience: feeling like you understand it after reading parts of a thick book on Git, only to become flustered again when you encounter an error message during actual work.

ย 

We highly appreciated how Julia pinpointed that exact gap. Above all, this sentence particularly resonated with us.

You are in 'detached HEAD' state

If you are a developer, you have likely hesitated at least once after seeing this message.

"What does this mean?" "What should I do now?" "If I touch the wrong thing, will something break?"

ย 

I have also had similar concerns as you. That is why I felt this book is less about trying to explain everything about Git, and more about helping you understand why Git behaves the way it does.

ย 

And as that understanding builds, Git becomes a tool that is a little less unfamiliar and a little less intimidating. I hope that through ใ€ŠHow Git Worksใ€‹, you too will come to understand Git a bit more and fear it a bit less.

โ€” BFS ๐ŸŽฒ

Comment