How To Use GitHub
Before my software dev program began, I signed up for a GitHub account. I had no idea what it was for I just knew it was needed. I'm one of those people that adapts well to technology, and am able to figure out how to use new systems or software fairly quickly.
Well, not GitHub. The entire user interface was incredibly challenging to navigate. Mostly because there was a lot of terminology that I didn't understand like forking, merging, pushing, cloning, branches, etc. I searched high & low for what likely was a good hour on the hunt to find a simple upload button. I didn't even have a repository yet! I can think back and laugh now, but I know it was not a laughing matter then so in this post, I will explain how I use GitHub & how you can too.
The Basics
This post will assume you already have an account created and Git installed on your computer. The purpose of using GitHub is to: show your code to other people, work on code with other people, and see other people's code. There are other official definitions; but, in layman's terms, that's basically what it's for.
Version Control
If you are new to software dev, you may have seen the topic of version control a lot. Essentially, as you make changes to a project's code, and you are working on a team, people naturally want to know what those changes are and why they were necessary. Think of version control as change history, or update history.
The absolute fundamental basis of GitHub while working on code with other people is to show those changes and explain them via what is called a commit. I'll explain further, but a commit is like a snapshot of your updates. It captures the history of your updates, so other people can understand what you’ve done and why.
How To "Git" Your Project on GitHub
So you're ready for the world to see your work? If so, we need to do three things: stage, commit, & push. You'll also need a repository and your computer's terminal. FYI - depending on the project, and if you are checking out of branches, there will likely be more steps involved. In the terminal, run the following:Run #1: cd c://folder/folder/my-project
Run #2: git add .
Run #3: git commit -m "Describe The Update Made"
Run #4: git push
The above assumes that you already have initialized or cloned a repository. It also assumes that your GitHub keys are set up. If not, freeCodeCamp has a great article that expands on the topic here.
So that's it. Keep it simple... Also, if you ever need to switch GitHub accounts (I use both my personal & student account), you might run into a permissions problem. I have this article bookmarked on my computer for the fix and it works like a charm.
Thanks for reading,
Shanell A. Spann
Connect with me on:
My Site – https://htmlbyshanell.com/
GitHub – https://github.com/HTMLbyShanell
YouTube - https://www.youtube.com/channel/UC3EaLC-43IlJYMcykUBnkog
LinkedIn – https://www.linkedin.com/in/shanellspann/
Comments
Post a Comment