terrajobst2024-03-11T21:06:20+00:00http://immo.landwerth.netImmo LandwerthMounting folders as drives (without SUBST)2021-07-04T00:00:00+00:00http://immo.landwerth.net/2021/07/04/subst<p>When I got my first job as a developer in '97 my coworker introduced me to using
a drive as the root for all the source code. This is awesome because it means
it's super fast to get to, no matter where you are: some Windows file dialog,
Windows Explorer, or the terminal. Your source code is always only three letters
away. Of course, this technique isn't limited to source code. It can apply to
anything you're working on: documents, photos, or videos.</p>
<p>For the longest time I've used <code>SUBST</code> to achieve this, but in this post I'm
going to show a much better alternative.</p>
<h2 id="whats-wrong-with-subst">What's wrong with SUBST?</h2>
<p>Using <code>SUBST</code> is pretty easy. You only need a batch file like this:</p>
<div class="language-batch highlighter-rouge"><div class="highlight"><pre class="highlight"><code>@echo <span class="na">off</span>
<span class="nb">subst</span> <span class="kd">P</span>: <span class="kd">D</span>:\Projects
<span class="nb">subst</span> <span class="kd">T</span>: <span class="kd">D</span>:\Trash
</code></pre></div></div>
<p>In this case, I'm mounting <code>D:\Project</code> as my <code>P:</code> drive and <code>D:\Trash</code> as my
<code>T:</code> drive.</p>
<p>The issue with <code>SUBST</code> is that it's only visible to the current user. For most
cases that seems appropriate but even if you only use a single user, those
drives aren't visible inside an elevated context, which can be extremely
annoying. Also, there is a minor issue that the batch file needs to be
registered as a startup script which sometimes means you have to wait after a
reboot before you can access the drives. Not a biggie, but still.</p>
<h2 id="the-solution">The solution</h2>
<p>I recently did some digging and found this nifty solution on <a href="https://superuser.com/a/29076">Super User</a>.
Basically, it registers a virtual drive for the entire machine. You can even run
services off of it!</p>
<p>The only caveat is that you need to prefix the path with <code>\??\</code>. In case you use
a <code>.reg</code> file (which you should so you can recreate this when you need to set up
your machine again), you also need to escape the backslashes by doubling them.</p>
<p>For my case this looks as follows:</p>
<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices]
"P:"="\\??\\D:\\Projects"
"T:"="\\??\\D:\\Trash"
</code></pre></div></div>
<p>Just put the content in a file with the extension of <code>.reg</code>, run it, and restart
your machine. Done!</p>
<h2 id="name-and-icon">Name and Icon</h2>
<p>While you can't rename these virtual drives by using properties, you can assign
default labels and icons in Windows Explorer.</p>
<p>For this to work, the drive name of the underlying drive has to be empty. For
example, if you mount <code>C:\work</code> as <code>D:\</code>, then the name of the C drive needs to
be empty. In order to see a name in Windows Explorer you need to assign the
<code>DefaultLabel</code> under the <code>DriveIcons</code> folder for the respective drive.</p>
<p>In my case all the folders are on the <code>D:</code> drive, so I remove the drive name for
it and set its default label to <code>Data</code>:</p>
<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\D]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\D\DefaultLabel]
@="Data"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\P]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\P\DefaultLabel]
@="Projects"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\P\DefaultIcon]
@="D:\\Tools\\Icons\\projects.ico"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\T]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\T\DefaultLabel]
@="Temporary Projects"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\T\DefaultIcon]
@="D:\\Tools\\Icons\\temp_projects.ico"
</code></pre></div></div>
<h2 id="how-i-use-it">How I use it</h2>
<p>Some people use <code>C:\src</code> as the root for their source code. Sure, that works
too. But I generally don't want to store anything on my <code>C:</code> drive that I care
about. For me, <code>C:</code> is only for the OS and apps. Everything else goes on <code>D:</code>,
which is usually a physical drive or at least a partition. This makes it very
easy to reset the machine too. No need to worry about accidentally nuking any
documents or projects you care about.</p>
<p>Of course, <code>D:\src</code> would equally work, but I like to organize my <code>D:</code> drive a
bit more, but I don't want to sacrifice how easy it is to get to.</p>
<p>Also, using virtual drives allows you to standardize the drives between
machines. For example, I sometimes don't have a secondary drive or I have
multiple drives so on different machines my source code might actually lie on
different drives. With a virtual drive letter that is in the middle of the
alphabet you can likely ensure that you can use the same letter across all
machines.</p>
<p>For the most part I use <code>P:</code> and <code>T:</code> drives:</p>
<ul>
<li>
<p><strong><code>P:</code></strong> represents the home of projects, so each top level folder is some git
repository.</p>
</li>
<li>
<p><strong><code>T:</code></strong> represents all the temporary stuff I'm doing. You know, where
<code>ConsoleApplication32</code> lives.</p>
</li>
</ul>
<p>At some point I also had <code>M:</code> where I stored media files (e.g. icons) and <code>V:</code>
where I put my videos for editing.</p>
<h2 id="caveats">Caveats</h2>
<p>There are a few restrictions for virtual drives:</p>
<ol>
<li><strong>You can't name them</strong>. They inherit the drive name from the directory's
drive (see above for the workaround in Windows explorer).</li>
<li><strong>Can't use the recycle bin</strong>. You can't use recycle bin functionality on
virtual drives, that is all deletions are permanent.</li>
</ol>
<h2 id="summary">Summary</h2>
<p>Virtual drives are awesome. <code>SUBST</code> can be awkward but when you register them in
the Windows Registry, they just work great.</p>
My fitness journey2021-02-02T00:00:00+00:00http://immo.landwerth.net/2021/02/02/fitness<p>As of the beginning of this year, I've started to work out and lose weight. Some
of you asked me what my regime looks like so I thought it would be good to write
a blog post about it.</p>
<h2 id="progress">Progress</h2>
<p>First some quick before/after so you get a sense of what I've done so far.</p>
<p>This was me in January of 2020 at around 108 kg (238 lbs):</p>
<p><img src="/assets/2021-07-02-me-before.jpg" alt="Me, as January 2019" /></p>
<p>This is me as of right now at around 84 kg (185 lbs):</p>
<p><img src="/assets/2021-07-02-me-after.jpg" alt="Me, as of right now" /></p>
<p>My diet started around mid-December in 2020. So it took me about six months to
lose most of this weight. You might notice the end is going up again. I'll talk
about that later.</p>
<p><img src="/assets/2021-07-02-progression.png" alt="Progression" /></p>
<h2 id="approach">Approach</h2>
<p>If you've been trying to lose weight before you might feel overwhelmed by all
the information you can find, especially on YouTube. But don't be blinded by all
the woo-woo fitness advice. In the end, it's quite simple: it's <em>calories in vs
calories out</em>, so you need to be in a calorie deficit. In other words, in order
to lose weight, you need to consume fewer calories than what your body needs.</p>
<p>I've lost weight before, also around 25 kg (55 lbs). But over the years I gained
it all back. If you've ever done a diet, you're very likely to be in the same
boat. I've heard various numbers, but it seems the vast majority of people who
go on a diet regain all of their weight back in a few years. Some gain even
more.</p>
<p>Most of us don't eat at maintenance, we eat at a caloric surplus. The reason is
very simple: food is ubiquitous, especially delicious foods. And the food
industry generally doesn't try to optimize for low calorie foods, but for foods
that taste great and the highly palatable foods just tend to have more calories.</p>
<p>As a result, it shouldn't really be surprising that if you follow diets only
temporarily and then revert back to previous eating habits, you end up regaining
all that weight.</p>
<p>When I started this time, I was very well aware of that. My plan was as follows:</p>
<ol>
<li>
<p><strong>Do some temporary diet to lose weight</strong>. Ideally, relatively quickly. I was
already running for a few months again and running with less weight is
obviously more enjoyable.</p>
</li>
<li>
<p><strong>In parallel, build a plan to make the weight loss permanent</strong>. Even with
regular workouts that means lowering the overall caloric intake.</p>
</li>
<li>
<p><strong>Workout</strong>. When I was a teenager, I was quite fit. I did karate, swimming,
and a ton of biking (because I didn't have a car yet). In my twenties, I
pretty much focused on my career and stopped working out entirely. About 10
years ago, I got into running and I've been doing this on and off for a
while. Running burns a ton of calories, so part of my strategy was
incorporating a regular workout into the overall regime.</p>
</li>
</ol>
<h3 id="some-diet-to-lose-weight-nutrisystem">Some diet to lose weight (Nutrisystem)</h3>
<p>I wanted something dead simple to lose weight. I wasn't keen on tracking
calories of the food I'm eating right now, because I'm doing a combination of
cooking and eating out and in both cases the food was varying so much that it
would be a pain trying to track it all.</p>
<p>So I was looking for some food service that would send me food. With that, I was
quickly able to find <a href="https://www.nutrisystem.com/">Nutrisystem</a>. Following my
usual approach of not relying on marketing material, I went to YouTube and
watched reviews. The key takeaways:</p>
<ol>
<li>
<p><strong>Nutrisystem provides you with four types of foods</strong>. You get breakfast,
lunch, dinner, and snacks (twice daily). Each time you eat, you pick an item
from the group.</p>
</li>
<li>
<p><strong>All items have bar codes and can be tracked with MyFitnessPal</strong>. That is
extremely convenient and one of the primary reasons why I chose them.</p>
</li>
<li>
<p><strong>It's portion control with an aggressive deficit</strong>. My maintenance is about
2,500 calories, and they provided me with ~1,200 calories. With Nutrisystem
you're supposed to supplement yourself with vegetables and fruits, but let's
face it: most of us are too lazy for that.</p>
</li>
<li>
<p><strong>The food is OK</strong>. It's not terrible, but it's still far from great. The
nice thing is that it's brain dead easy to prepare: oven or microwave. Some
food is ready to eat as-is.</p>
</li>
</ol>
<p>I ended up using Nutrisystem for about three months. Did it work? Yes. But I was
often hungry, which I didn't mind too much because I knew I wouldn't be doing
Nutrisystem forever. But regardless of what I eat, I knew I wouldn't be able to sustain it if the
feeling of hungriness would be with me all the time. Eventually, I'd be "hangry"
enough that I'd end up with a big binge.</p>
<h3 id="making-it-stick-the-circle-diet">Making it stick (The Circle Diet)</h3>
<p>Since I was already used to cooking, I was in the beginning just googling for
"healthy food" recipes. But it quickly became clear that healthy doesn't
necessarily mean that you don't gain weight. Also, a lot of the recipes were
part of some overall diet plans, like a vegan diet, keto diet, or no carb diets.
I didn't like the idea of removing entire food groups because I knew that (1) I
enjoy eating them way too much and (2) I need to find an eating habit that still
allows me to go out with friends where I can pretty much eat whatever I want.</p>
<p>At the same time, I was also looking into weight lifting. I don't just want to
be lean, I also want to have some muscle. Not hercules, but maybe Brad Pitt in
Fight Club. Apparently <a href="https://youtu.be/5zhLw1st_z0?t=68">everyone wants to look like</a> Brad Pitt in
Fight Club.</p>
<p>By doing so I came across this fella <a href="https://www.youtube.com/user/gregdoucette">Greg Doucette</a>. At first, I found his style
somewhat off putting (loud & shrill) but after watching a few videos I was hooked
on the information he provided. Yes, he promotes his own stuff like every other
fitness YouTuber, but he also provides solid and easy to understand information
on weight loss and working out.</p>
<p><a href="https://www.youtube.com/watch?v=Ci7o4BjiJtI">His approach to weight loss</a> intrigued me: you should only do diets that
you can sustain for the rest of your life. And he focuses on low calorie-dense
foods. And of course protein, because it makes you more satiated. You're
probably thinking brocoli, rice and chicken but you'd be wrong: it includes
<a href="https://www.youtube.com/watch?v=z-p84S56h3U">french toast</a>, <a href="https://www.youtube.com/watch?v=EEHyY3dukic">pizza</a>, and home made <a href="https://www.youtube.com/watch?v=uSx8Dk-ROZU">Skor protein bars</a>. The photo also shows
cauliflower rice with chicken, but only because I happen to really like it 😊</p>
<p><img src="/assets/2021-07-02-foods.jpg" alt="Foods" /></p>
<p>Turns out Greg also has a <a href="https://www.gregdoucette.com/products/cookbook-2">cookbook</a> so I bought that. And yes, at $149 it's not
cheap but it's full of recipes. You probably won't like them all, but in reality
you only need to find a few dozen that you really enjoy eating to have a solid
backbone for your day-to-day eating habits. In my case, it's not even that many.</p>
<p>I eat the <a href="https://www.youtube.com/watch?v=z-p84S56h3U">french toast</a> almost every morning. Greg prepares them in bulk, but
screw that. I rather spend the 10 minutes every morning and have them fresh
because taste wise it makes a huge difference. For lunch, dinners, and snacks I
often do his wraps. The flat bread for the wraps can also be used to make
delicious <a href="https://www.youtube.com/watch?v=EEHyY3dukic">pizza</a>. "But Immo, that's not pizza." I know, but that's not the
point. The diet provides you with food options that are 80% as tasty as the food
you're craving but have a calorie profile that doesn't break the bank. For
example, the <a href="https://www.youtube.com/watch?v=EEHyY3dukic">pizza</a> has about 300 calories and the french toast has about 370.
But in contrast to Nutrisystem these are meals that will make me satisfied. Not
stuffed, but satisfied.</p>
<p>The book also covers snacks. Among the most simple ones is just popcorn, but you
need to <a href="https://www.amazon.com/gp/product/B00NBYVMBS">buy the right one</a>. It's about 200 calories for entire the bag
(not all kernels pop).</p>
<p>When I buy stuff, I try to find zero calorie options, especially when it comes
to drinks. Don't drink your calories. It's way too easy to consume a lot of
calories in liquid form. If you're currently drinking a lot of regular coke,
just switching to diet coke will likely drastically reduce your intake. I tend
to avoid pre-sweetened stuff and add Splenda as needed. And if you like milk,
have a look at <a href="https://www.amazon.com/dp/B00TZFTCPK">cashew milk</a>. I think it's among the more neutral milk flavors
but it's only 25 calories for a cup. That goes a long way to help with my
coffee, tea, and shake needs.</p>
<p>How do you know how many calories you need? You don't. There are online
calculators that give you an idea, but they are all just that: ideas. In the
end, you can't track calories or exercise with a super high degree of accuracy.
However, this doesn't mean you shouldn't. I found it super useful to track
everything I eat so that I can get an idea how many calories are in the foods I
eat. This also includes measuring the food itself, especially oils and
condiments which tend to be very calorie dense.</p>
<p>But the most important thing to measure is your own weight. I bought a smart
scale because I was sick and tired of manually entering my weight in all my
fitness apps. I used the Garmin Index scale until I recently lost it. Now I have
the <a href="https://buy.garmin.com/en-US/US/p/679362/">Garmin Index S2</a>, which was a solid upgrade anyway.</p>
<h2 id="working-out">Working out</h2>
<p>As I said earlier, I've picked up running about ten years ago. Since I'm a fan
of gadgets, I eventually also bought a <a href="https://buy.garmin.com/en-US/US/p/137024">Garmin running watch</a> to monitor
my heart rate. What's nice with Garmin is their Garmin Connect website. It
allows you to analyze and catalog all your runs and also sync it with other
social media sites, such as Strava. They also have training plans (such as 5k,
10k, half, full) in various levels (beginner, intermediate, advanced). You can
just pick a plan and a start date (or a finish date, in case you want to prepare
for a race) and they schedule it. Typically, these plans go between 12 and 16
weeks.</p>
<p>The cool thing is that those plans sync with your watch and/or favorite
calendar, telling you what you need to do. For simple runs, such as "run for 30
minutes" all you need is the plan, but for structured workouts, such as
intervals, I really like that the watch can tell me what to do, when to do it,
and give me feedback as I'm doing it. For example, when doing intervals the
workout might look like this:</p>
<ol>
<li>10 min warmup</li>
<li>Run for 5 min in heart rate zone 4</li>
<li>Jog for 1 min in heart rate zone 2</li>
<li>Repeat steps 2-3 four times</li>
<li>10 min cool down</li>
</ol>
<p>The watch will inform me when one part ends and another starts. It will also
tell me whether I'm hitting my heart rate or my pace goal.</p>
<p>I found having a structured training plan that's going on for months keeps me
more motivated and engaged because I know missing one workout will make the next
workout that much harder because they are all progressive. Right now, I'm
following the full marathon intermediate plan, which has me workout 5 times a
week.</p>
<p>Did I get fitter? For sure. One commonly accepted measurement of cardiovascular
fitness is <a href="https://en.wikipedia.org/wiki/VO2_max">VO2 max</a>. In my case it has improved quite a bit since I started
last year. According to Garmin:</p>
<blockquote>
<p>Your VO2 Max is in the top 5% for your age and gender.</p>
</blockquote>
<p>Still not an athlete, but I am fit, which was the goal.</p>
<p><img src="/assets/2021-07-02-vo2-max.png" alt="VO2 Max chart" /></p>
<p>So when I decided to start lifting weights I was looking for something
structured as well. I didn't just wanna go to the gym and do whatever because I
was pretty certain that this would result in (1) an ineffective workout and (2)
me losing interest. I have tried a personal trainer before (did it for a few
years even). But the problem is that it's expensive and I only went twice a week
for 30 minutes, which isn't enough volume to produce sufficient results. Also, I
found that this forced self-accountability which makes it easier to stay
motivated and stick to the plan.</p>
<p>When researching, I found <a href="https://fitbod.me/">Fitbod</a> which is a mobile app for weight lifting. The
app allows you to keep track of the exercises you did, including how many sets
and reps and what weight you used. Based on that (and based on other information
you provided when setting it up) the app can then determine which muscles are
fatigued and propose exercises the next time you go. However, that's not how I
roll. I ended up creating my own two workout routines that I do alternatingly.</p>
<p>I only use the app to keep track during the workout and also to remind me what I
did last time. That's important because the goal of weight training is usually
to do progressive overload, so that the muscle is damaged in order to grow.
Knowing how many sets and reps you did last time helps. I tend to increase reps
or sets, then bump the weight while dropping reps and then increase reps and/or
sets again. Has worked fairly well so far.</p>
<p>Here is what I currently do:</p>
<p><strong>W1</strong></p>
<ul>
<li><strong>Pull ups</strong> (4 sets of 6 reps)</li>
<li><strong>Cable crossover fly</strong> (4 sets of 14 reps 30 lbs)</li>
<li><strong>Machine reverse fly</strong> (4 sets of 12 reps 100 lbs)</li>
<li><strong>Scapular pull ups</strong> (4 sets of 15 reps)</li>
<li><strong>Lat pulldown</strong> (4 sets 10 reps 115 lbs)</li>
<li><strong>Dumbbell bench press</strong> (4 sets 14 reps 45 lbs)</li>
<li><strong>Cross body hammer curls</strong> (3 sets 12 reps 25 lbs)</li>
</ul>
<p><strong>W2</strong></p>
<ul>
<li><strong>Dumbbell bicep curl</strong> (4 sets 14 reps 30 lbs)</li>
<li><strong>Smith machine bench press</strong> (4 sets 12 reps 80, 90, 100, 110 lbs)</li>
<li>Superset of (4 sets)
<ul>
<li><strong>Dumbbell lateral raise</strong> (12 reps 15 lbs)</li>
<li><strong>Cable triceps extension</strong> (14 reps 50 lbs)</li>
</ul>
</li>
<li><strong>Standing dumbbell should press</strong> (4 sets 12 reps 15 lbs)</li>
<li>Superset of (4 sets)
<ul>
<li><strong>Vertical leg raise</strong> (14 reps)</li>
<li><strong>Dips</strong> (8 reps)</li>
</ul>
</li>
</ul>
<p>However, since this is the workout I cooked up for myself, a few days ago I
decided to purchase a <a href="https://www.gregdoucette.com/collections/all-coaching/products/custom-training-program">custom training plan</a>. I haven't received it yet, but I'm
looking forward to see what this will do for my training. My expectation is that
it will diversify my training a bit and make it more balanced. For example, I
currently don't have a pulling motion for my back and I don't train legs at all.
The latter is deliberate (I'm already running), but I probably should do some
amount of leg training.</p>
<h2 id="set-backs">Set backs</h2>
<p>Earlier, you probably noticed the spike at the end:</p>
<p><img src="/assets/2021-07-02-progression.png" alt="Progression" /></p>
<p>That's not me having a binge eating relapse, that's called life. We remodelled
our place which resulted in us moving to a separate place. Due to not having my
regular kitchen and gym I fell of the wagon. I ended up not paying attention to
calories, nor was I able to make my regular food and take out took over. Also, I
somehow managed to lose my scale which resulted in me not even tracking my
weight.</p>
<p>That is completely normal. Life will always happen and long term goals like
getting into shape don't happen on straight lines. When this happens, the
important thing is to not be deterred. Instead, dust yourself off and get back
on the wagon. Yes, I gained some weight, but that's OK and easy to fix again
with some amount of discipline and patience.</p>
<h2 id="summary">Summary</h2>
<p>I've lost 24 kg so far. My goal is to see whether I can have a visible six pack.
I have very little fat on arms and legs, so I'm unlucky in that this would
require to get my body fat to 10-12%. Right now I am at 21%. I have no idea
whether I'm able to stay that lean or if the hunger will push be back to around
20%. Health wise, my current figure is more than sufficient and I'm confident I
could maintain that. But now I really want to know what I can do, so we'll see
😊</p>
Is Git acquired taste?2015-11-08T00:00:00+00:00http://immo.landwerth.net/2015/11/08/git-acquired-taste<p>Ever since my team decided to move to Git I was involved in discussions on how to use Git. This included basic questions like "how do I check in" as well as
higher level questions like "how should we model code flow". My team is using Git for over a year now and I'm still running into folks that find Git complicated, cumbersome, and generally ugly. Where does all that resistance come from?</p>
<h2 id="im-not-a-hacker">I'm not a hacker</h2>
<p>First let me start by saying I was never a Unix hacker. In fact, when I joined Microsoft five years ago I wasn't a command line aficionado either. I'm the kind of guy that really enjoys UI and will zoom in to fix off-by-one pixel errors.</p>
<p>However, I'm in love with Git ever since I moved switched from Mercurial about three years ago. The fact that so many folks I deeply respect and admire seem to think Git is complicated made me wonder why <em>I</em> like it. I don't think of myself as particularly clever. I already told you that I'm not a command line hacker (I still can't seem to remember the syntax of <code>findstr</code> for fuck's sake).</p>
<p>So I wonder what causes so much resistance that I've seen for Git.</p>
<h2 id="why-the-strong-dislike-for-git">Why the strong dislike for Git?</h2>
<p>A couple of days ago I had a thought. Maybe it's not that Git is hard, ugly, or complicated. Maybe it's a matter of first impression. I tweeted the following:</p>
<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">I've come to believe that Git is an awesome tool for a single developer but acquired taste for a team environment.</p>— Immo Landwerth (@terrajobst) <a href="https://twitter.com/terrajobst/status/663222749188329473">November 8, 2015</a></blockquote> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
<p>Many folks replied and pointed out that Git is an excellent tool for teams -- given that I really love Git it should not come as a surprise that I think so too.</p>
<p>I tried to say something different. When you learn Git as a tool to organize yourself your perspective is drastically different from when you learn Git to organize a team. Let's compare them.</p>
<h2 id="git-for-individuals-vs-git-for-teams">Git for individuals vs. Git for teams</h2>
<p>Git was designed around automating the patch submission process the Linux kernel developers uses. <a href="https://www.youtube.com/watch?v=4XpnKHJAok8">Linus wanted a system</a> where he gets exactly out what he put in. Once you have that mindset, it's obvious that you want your own repository that only <em>you</em> have access to and that all operations are based around a pull-based model.</p>
<p>In other words: you <em>pull</em> changes from people you trust rather than letting trusted people <em>push</em> to an agreed-upon sync point.</p>
<p>This model is so successful that it found wide adoption outside the Linux kernel. In fact, GitHub is "nothing more" <em>handwavymotion</em> than a web front end over Git and this process. GitHub provides a first class feature to allow people to <em>request</em> to pull their changes. This pull request feature is great because it combines code flow with code reviews.</p>
<p>Needless to say that the pull request process can even be used in cases where all participants are in fact allowed to push their changes directly to the centralized sync point. That's akin to ignore the guidance to conduct a code review before checking in (however, a kitten dies every time it's done).</p>
<p>In a centralized version control system (CVCS), such as SVN, TVFC, Perforce, you simply check in. The only thing you may do before is using whatever your code review tool is. That's it.</p>
<p>You may argue that I'm simplifying a lot in that CVCS isn't that easy either. You're correct. But folks <em>already</em> have those skills. Even worse, they are <em>ingrained</em> in most professional devs.</p>
<p>Trying to explain why they need to fork, clone, commit, push to origin, create PR from origin to upstream, squash, and merge, is an exercise in patience -- for both sides.</p>
<h2 id="git-is-special">Git is special</h2>
<p>"But surely technology is always changing", you must think right now. That's true, but I believe Git is somewhat special in that it's the only version control tool that I know of that has a reputation of being excessively complicated.</p>
<p>Here are two popular examples:</p>
<ol>
<li><a href="http://xkcd.com/1597/">XKCD</a></li>
<li><a href="http://git-man-page-generator.lokaltog.net">Fake man pages for Git</a></li>
</ol>
<p>The fake man pages highlight how hideously complicated and absurd Git can appear to newcomers. Here is <a href="http://git-man-page-generator.lokaltog.net/#4ae83247df429db41968bc5618c22612">an example</a>:</p>
<blockquote>
<p>git-lick-archive — lick some non-filter-branched downstream archives next to a few diffed non-repacked local remotes</p>
</blockquote>
<p>At this point, it should be clear that I believe one reason for this perception is that the workflows of distributed version control (DVCS) are simply different from the ones used in a CVCS, which are what most teams still use.</p>
<p>Another reason is the command line. The command line wasn't necessarily designed top-down but rather grown over time. It suffers from complex terminology and many inconsistencies of operations between different commands. Example? Sure:</p>
<pre><code>git tag rm old-tag
</code></pre>
<p>Sigh. You just created a tag called <code>rm</code> that points to <code>old-tag</code>. Obviously.</p>
<h2 id="ok-whats-your-point">OK, what's your point?</h2>
<p>If you read that far, you must wonder what exactly my point is. Hey, it's my blog. I get to rant all I want here. I'm under no obligation to provide a conclusion.</p>
<p>Nonetheless, I do have some thoughts on how to make folks more successful in learning Git:</p>
<ul>
<li>
<p><strong>Have a single centralized repo, no forks</strong>. First of, I believe it's much easier to switch to Git from a CVCS if there is the one true copy. Yes, this means no forks. I can't count then number of times I had to explain the difference between origin and upstream to team members. Avoid that if you can.</p>
</li>
<li>
<p><strong>Use the command line</strong>. What? UI is much easier! I beg to differ. UI might make your workflows smoother but it doesn't help you to understand Git. Also, if you google a question, you're much more likely to find a command line based answer than a step-by-step recipe for the UI you happen to use. The command line also helps you to learn the official Git terminology -- many UI tools have their own lingo.</p>
</li>
<li>
<p><strong>Watch a video on Git internals</strong>. Seriously? I'm not going to use hex editor to check in. Riiiight. But understanding the basic way in which Git thinks helps you to predict what commands will do, how they behave, how to recover from mistakes, and what the limitations of Git are. An excellent video is <a href="https://www.youtube.com/watch?v=MYP56QJpDr4">Git From the Bits Up</a>.</p>
</li>
<li>
<p><strong>Read a book on Git</strong>. Come on, I didn't need to read a book on <your current version control tool>. That might be true, but you've a lot of experience in using it. The easiest way to jump start is by reading a short book on Git. Invest half an hour every night for about a week. The return on invest is huge. And if the book is well written, you might actually enjoy it. I really liked <a href="http://www.amazon.com/dp/0983507902">Version Control By Example</a>.</p>
</li>
<li>
<p><strong>Give up and ask your local Git expert</strong>. Don't laugh. We're social beings and we learn a lot by asking a coworker. However, in your own interest you shouldn't ask your expert every time you need to commit; but it's better to ask than to become horribly inefficient due to lack of understanding.</p>
</li>
</ul>
<p>Happy hacking.</p>