Git and GitHub

When I first learned about GitHub, I thought it was just a website. It was very confusing and intimidating. However, I was told by peers the importance of GitHub for programming, and especially because I had found myself at a dead end during an early programming project.

I have a (somewhat embarrassing) first project up on GitHub (which is a perfect example of code that needs to be cleaned up–a fun idea for a future project). However, that first project from years ago was a great introduction to GitHub.

First, Git and GitHub are not the same thing. When I looked up “what does Git stand for?” I stumbled upon an interesting story. Git is actually not a meaningful acronym, instead it was chosen because it was most likely to never be used and mess up someone’s code. The story goes as so:  Torvalds created the software and named it after the British slang word, “Git,” which translates to “a rotten person.” 

GitHub is a website, a service, where people can collaborate and track the history of code. It’s a wonderful space for people to learn and grow. However, it is possible to be proficient in using just the GitHub website without actually working with Git through the terminal, and vice versa.

The goal is to balance usage of both Git and GitHub through the terminal and website. Prior to this post and day of studying, I had mostly just worked on the GitHub website and not the terminal. Having gone through multiple videos so far from the “Git and GitHub for Poets” video series by The Coding Train on Youtube, I’m more familiarized with working in the terminal with Git and GitHub. It’s been an interesting ride, and this is just the beginning!

Link to series playlist: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZF9C0YMKuns9sLDzK6zoiV

Glossary of Important Terms

Here are some notes I took while watching the above tutorials. Hope you find them as helpful as I do!

Git: version control software

GitHub: web service where people can collaborate on open source code and track project history

Repository (or, “repo”): a project; a repository of files. Repository names can’t have spaces so they will include a dash as in: repository-title-example

Commit: a change to a file that is saved in the repository

Commit Hash: a unique identifier for each particular commit

Master Branch: original origin of a repository

Branch: a copy of files for experimentation before a commit is merged to the master branch

Pull Request: a way to ask the collaborators of a repository to approve your changes and merge them into the master branch

Merge: the action of a pull request successfully combining changes into the master branch of a repository

Fork: copying the repository to have under your own account for experimentation without effecting the original core version

Issues: a place to leave a comment about a problem, or to ask a question. Raising an issue means to file a potential bug

Fixes: if you use the word “fixes” in a commit changes title, the issue will be automatically closed

Remote: duplicate instance of a repository that exists on a server. When you say “git push” you need to say “git push __where__”

*Tip on Commit Hash Codes: place the commit hash code in a comment to help link to the issue

Terminal Instructions (via GitHub):

to create a new repository on the command line:

echo "# terminal-practice" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/KIBautista/terminal-practice.git
git push -u origin master

 to push an existing repository from the command line:

git remote add origin https://github.com/KIBautista/terminal-practice.git 
git push -u origin master

Practice Progress

After some trial and error, I was successfully able to push a new file into my GitHub repository through the terminal. It was very cool to see it work! I ran into some trouble shooting errors with getting into the proper place on my desktop for the repository, and for getting the remote to work, but finally, it has worked!

I found trying to change my login information through the terminal to be a little convoluted, and I was worried that an incorrect password was the cause of my push updates not going through. However, seeing my text file successfully added on GitHub through the Terminal confirms that the password and login is correct.

I feel more confident now to look around on GitHub for open source projects and contribute to them, which is the goal!

For anyone wishing to learn more, the video series I have found to be incredibly helpful is available for free on YouTube, and it is called “Git and GitHub for Poets” by The Coding Train. I very much appreciate the depth and visual interface used in this videos; they’re very user friendly and great for beginners!

Leave a comment