Actually Learning git
Git has been essential for my "workflow" for a long time.
In reality git has only served a limited purpose for me:
- Project management - keeping related files and stuff together.
- Backup - this honestly has been the primary purpose.
- Replication on new machines.
- Occasional sharing of code
- Occasional version control / review.
I have overwhelmingly only used the master branch for my work. Most of my commit messages are basically useless, e.g. "update". I am sure none of you have ever done this, or rather still do.
As I began toying more and more with my "homelab", I began to at least use branches, do more frequent commits, and give useful commit messages. Magit really made this simple as committing hunks (sometimes called partial commits) is very easy. I think I'm almost at 1000 commits on my emacs config, tons of tiny commits and zero squashing, made quick and easy via magit.
Inevitably I ran into situations where I pushed updates from one computer, forgot to pull from a second computer prior to doing work, and then ended up with conflict messages when I pushed from the second computer. Skill/habit issue. Typically I would blindly copypasta whatever git recommended (e.g. rebase true), which most of the time worked, and if not I knew enough about git to get around to where I needed to be, typically via stashing changes. This is definitely something I am sure the reader never has done or is currently at this time doing.
I decided that I wanted to learn git from the ground up as a lot of the material out there doesn't start with esoteric fundamentals of what git actually is.
From a learning standpoint I learn by doing and watching, and then once I have a grasp on the material I like to read reference manuals.
Starting off with man pages generally isn't the best way that I learn.
Like any professional I watched a few yt vidjas which basically said all the basics I had already known. Then I stumbled upon The Primeagen's exactly 4-hour and 20-minute git course and figured this would have more nuggets (and humour) than all others. That has proven to be true.
I don't really consume The Primeagen content, not really my style or vibe. But The Primeagen has this one simple trick that makes him extremely effective (good use of research dollars btw).
His course is hosted at boot.dev and is free. I am not a fan of the website, but it is an interactive course which is the best way that I learn.
The content itself is absolutely outstanding. 10/10 would recommend. Linuxmaxxing dot com is not getting any kickback for the advert.
Perhaps it would have been overwhelming to learn at first, but nevertheless I wish I had at least learned the fundamentals of how git actually works under the hood very early on.
Notes
I have added a Notes section to my site. The purpose of the Notes section is to post notes. In other news water is wet.
To no surprise the first note in the Notes section are notes taken whilst (re)learning git. It covers the entirety of the course mentioned above, so if you're curious maybe skim through these notes to see if there are any gems or nuggets you were unaware of.
A while back I heard a note-taking strategy of making your notes public, not necessarily to benefit the public, but because it is a forcing function to write good, concise, and accurate notes which you will more than likely reread (and thus reinforce) prior to posting. Jury is out as to whether I'll meet that intention. Perhaps I (and perhaps you) will benefit from having them available. Plus it gives me a known, quick reference available anywhere as opposed to grepping through some less organized files.