Making friends with Github Pt 1

Nausheen Akhter
2 min readJul 2, 2022

First, a nod of the hat to Octocat, the Github logo. Apparently an inside joke between about 30 million software developers who use the platform to share code with each other, this creature in silhouette form is one of my favorite logos. Behind that joke, however, is an incredibly versatile open source system that can house millions of applications that utilize many different technologies.

Developers are all too familiar with the process of creating a Github project repository and committing changes in their code to that repository…and not being able to commit because of some mysterious error. Even as a new developer, I have spent many hours in panic mode when commits failed with an impending deadline. Enter Udemy course on Github basic troubleshooting strategies called Git Started with Github. I hope to share some of the things I learned here.

Conceptual foundations

First, a commits are “snapshots of your entire repository at specific times.” You normally make commits once you’ve written a unit of code — a few lines of code such as a simple function.

Second, a quick review of local and remote repositories, with respect to commits. There are three states of a local repository (in your computer) — working directory, staging area, committed (to Github) changes. Working directory is everything in your project file. Staging area (Git index) is the “place for queueing up changes for the next commit.” You normally add a name for each commit to reflect the new bits of code you’re adding, editing, or removing from the file. Files in this area can be moved in and out without affecting the local repository. The commit state is the history of commits of your Git repository. A fourth state is the remote state, which includes all the commits, including the most recent.

Did you know? I (kinda) didn’t

Although I installed a bunch of things when I started my software engineering bootcamp at Flatiron, including git (I’m pretty sure since I have it), I don’t remember installing it. But now that I’m doing this course, I can quickly install it in my new Mac (woohoo!). Another tidbit I didn’t notice even though I use it just about everyday: git commands are for the command line — it was designed for it and is still how git is primarily used. Git commands are the same across Windows, Mac OS, and Linux.

--

--