(The Great Journey #1) Solving my first real coding problem.
Published: 2022-09-04 00:04:01

*tap* *tap*

Is this thing on?

Hey everybody, my name is Toliver and in a few days I'll be starting a six month full stack coding bootcamp after graduating college with an English degree and a concentration in Creative Writing. After finding this website, I've decided that I'd like to catalogue the highs and lows of my software journey somewhere other than my desktop Sticky notes. Is it the right place? Maybe. We'll see, you know?


                    *   *   *

My first real problem arrived promptly two days ago. While completing some of the HTML prework for my bootcamp, I followed the instructions to switch back to my main local repository to create a new branch. And suddenly ... my files were gone. Banished to the boundless, murky ether of my Macbook. My Finder window managed to hang on to two of the four original files: README and a license.

A short thirty minute period of Googling and Stack Overflowing later I realized I had no idea what I was doing.

The next day I started from scratch, and after meticulously following each step, like clockwork, my files vanished when I switched to my main local repository. A new challenger entered the crucible: a lone, suspicious DS.Store file. After some research (which lead me to believe some nefarious band of foreign hackers had planted the DS.Store file themselves) I abandoned the bread crumb trail and refocused my attention on the mysterious vanishing index.html.

I met with a tutor for the first time later that day, who offered some sage wisdom that frankly went right over my head. And me, trying to seem smart and capable, smiled, scribbled some esoteric notes, and thanked him for his time after about five minutes.

Two hours ago, I started from scratch for the third time. No background music. No distractions. Like Leo DiCaprio's character "Cobb" in 2010's _Inception_, I planned this mission in the dimly-lit warehouse of my mind a thousand times over. Each step was a choreographed dance -- I'd seen it all before.

Create repository. Sync it with my Macbook. Add some Github issues. Relearn thrice over why we start an HTML document with _<!DOCTYPE html>_. I double, triple, and quadruple checked my work. I scrutinized each passing sentence with lukewarm coffee at my lips, and with a flourish of calculated keystrokes ... I downloaded the starter code.

There, in the small, white space of my Finder window, I greeted my old friend "Index.html" with open arms. Suddenly, the air in the room changed.

It wasn't the air conditioning. It was something else. _Heat. Pressure. Prickling sensations that crawled along the hairs on my neck._

The Game was afoot.

I kept my eyes on him and his cohort (README, License, and Assets) for as long as I could. I added them to the "feature/starter-code" branch. Everything seemed fine. Commit, Add, and Push to Github. Yes, yes, and yes. I relished in his presence, constantly checking the Finder window in the bottom left corner of my screen. Safe and sound.

But before I could tell him to stay, that nothing else mattered as long as we were together, the dreaded 3.1.5 module oozed like a hellish, caustic bile through the pixels of my monitor.

I gathered up all my remaining strength, took one final sip of now very cold coffee, and sacrificed Index.html to the Git Gods, like Abraham, when God tested his mettle and asked him to murder his only son. I closed my eyes and let fate decide the rest.

_git checkout main_

I opened my eyes. Where Index.html and Assets had stood only moments before, there were two empty, white, smoldering spaces. If I hadn't been sitting already, I would've sank crestfallen and hopeless to my knees.

"If I can't figure out something as trivial as HTML," I thought, "then maybe I'm not cut out for this stuff, after all." I leaned back in my chair and stared at the red, crossed-out text of "Index.html" in VScode.



Unless ...

Everything I'd read about a Git Workflow the past two days aligned like stars. I propped myself back up for one last desperate shot. Was it crazy? Yes. Dangerous. Surely. Borderline irresponsible? You bet your ass. But I wasn't ready to give up. Not like that. I took a deep breath.

_git pull origin main_

The room fell silent and the insects outside my office window stopped chirping.

My Terminal flickered.

My Finder window blinked, and two little files materialized in front of me.

                        *   *   * 

Hope you liked my story. I honestly can't believe that anyone would read this far. In layman's terms, my local main repository wasn't synced up with my remote main repository on Github. The local only had “READ ME” and license after I switched back to main and tried to create a new branch. This isn't in my story, but I realized that I hadn't thought to check back to my previous branch. When I did, the Index.html and Assets folder reappeared, and it became clear to me that files would disappear and reappear when I changed to different branches. And for some reason, I don't know why yet, my main local branch wasn't synced up with the stuff on Github. So, I went to the main branch and pulled from the remote main, and bingo-bango-bongo, it updated with the right files.

While this problem might seem infinitely less difficult for readers, for me, it was a dragon.

This post has turned into a _mother_ of a rabbit hole for me, so I'm going to climb out quietly, and return to my work.


Thanks for reading!