What is Git and Github?

WTFork is forking

Esther
3 min readJan 26, 2021

In addition to learning the basics of programming, one of my biggest hurdles at coding boot camp was Git. Even now, nightmares of mistakenly deleting weeks of work haunt every interaction I have with git. I’ll give a brief overview of my understanding of git and working with Github, then, go over some tips and tricks when working with git origin and git upstream that have helped me when working on labs with other students.

Git and Github

Github is the cloud and git as the way to access information or change information. Git is not specific to Github, there are other git services such as Bit Bucket and GitLab. They all host version-controlled repositories (repository/repositories are synonymous with repo/repos).

Forks

One of the distinguishing features of Github is the ability to fork a repository which basically means you have the ability to copy some else’s repository and make changes to it without affecting the original code.

Original work, Forked work, Forked work with changes

The original codebase displays a grid with an orange box. When you fork that repo, you’re creating a carbon copy but your carbon copy does not affect the original. If you change the code to make the lower right square green in your fork, the original repo will not be affected.

Learn how to fork a repo here

Cloning a fork

Now that you have a fork, somewhere in the GitHub cloud exists two of the same repos. You can clone the forked repo to hold a local copy of the forked repo on your computer. If you’ve ever used Google Docs, it’s like we’ve taken a shared doc that your friend has made, duplicated it, and then downloaded it so that we can make changes independently of the cloud doc.

Once the forked repo is on your computer, any changes you make to it will remain in your computer unless you explicitly tell git that you want to update the GitHub version with the version in your local. Back to the Google Docs example, the downloaded version on your computer is only accessible to you. Whatever changes you make on your computer is independent of the doc you downloaded from the cloud. If you want to back up your work, or keep it in a single location for others to review and see, you would push your changed version back up to the Google Docs cloud.

Confusing?

I definitely got hung up on the different places the code was moving in and out of. Not to mention, the versioning aspect of Github allows you to travel through time! We’ll get to that later ~

Resources

--

--