Github Basics

Nick Silas
4 min readNov 4, 2021

Hi friends. I am back to my old routine and I have been spending a lot of time reworking my old projects and it dawned on me that I am very fortunate to have a decent idea how to work with Github. For those who are new to software engineering, it can be daunting to pick up a tech skill that doesn’t lead to a new project but I assure you, this is a skill that will be beneficial for years to come. Let’s take a look at how to to get started and how to start adding Github to your skillset.

What is Github? Github is a code-hosting platform that allows you to share projects with others or store them globally. It allows you to share your work with others and also access other’s work for project sharing and project deployment. A basic way I see it is storing your projects in a public library (you can also set projects to be private). You can see the code of other’s projects which can be a very helpful way if you wanted to see how another project created their back end or how their nav bar works.

But how do we get going? It is actually pretty easy. Going to github.com and creating an account is the first step. That should be pretty basic in today’s day and age. Once this step is complete, you may want to start connecting your previous projects to your Github or start working on a project from scratch. To do this, both tying a project to Github and creating a new project follow the same steps

After logging in, look at the top left. You should see this new symbol. After selecting that, it will prompt you to create a new repository. This is the same for tying a project or creating a new one. Use a name that you have for your existing project or a new one for a new project. From here, you can see it has command line commands to tie them together. Enter your project’s folder locally on your computer. This should be fairly easy if you’ve been working on projects before. Once inside, you can see the two different selections. One is for a new project and one is for an existing project.

I personally use the last two options. Option one which is to create a new repository on the command line will create an empty shell for you to begin a new project. This is always the first step for me when I am starting a new project. The second option “or push an existing repository from the command line”. This will tie the Github repository to your project. I literally copy and paste this code and it works wonders.

Now that we can tie them, let’s take a look at some basic commands that you will need. “ git add . “ will tell your local repository to collect all files to get ready to send to github. The period after add just means all. You can use “ git add <whatever name of the file you want to send to github>”. I tend not to use this but I am positive it is something that has some use. After you have used “ git add . “, the next command is git commit -m “whatever message you want to show up “ . The “ “ marks are important after -m. You will see each version or time you save your project on Github, the -m stands for message so it leave a message of what you are changing or editing. This is extremely important especially if you are testing new functionality. It will allow you to rollback your project as long as you are committing often and leaving concise messages. I have personally broken projects and rolled back my project to the commit that had everything working. after you have used git add . then git commit -m “message info” , you will want to push the changes to Github. This command is git push.

This is a technique I use daily. You can see my git add . , my git commit -m “testing a commit” and then finally, git push.

These are the 3 basic commands you will use regularly. There is a ton more to look into and I think I will take next week to write about more complex git commands and where they are needed or used. I hope this is helping some newbies who are just getting into the game. As always, happy coding friends.

--

--