Nerdsense

GitHub: What's the fuss about?

Greg Heffner July 10, 2024
GitHub Logo

GitHub What a mysterious place. For someone who has never used it before, looking at GitHub might immediately cause anxiety. I know this was me at one time. I would look page after page at all the scripts, projects, repositories, and package versioning notes as if it was written in another language. I'm not a snake, how can I ever begin to understand Python.

GitHub is like a remote file storage server. You can log into it and retrieve things when you want. You can edit them and save them to be retrieved later. You can share items with other people. You can collaborate on projects without having to be in person. The difference between GitHub and a file server, though, is that GitHub gives you more control over your work.

Install GitHub here GitHub Download Instructions

Understanding five basic commands will get you most of the way to understanding how to use GitHub. I do recommend you look through this write-up if you would like more info on the other commands. Git Glossary

  • Git init

    This initializes a new repository in the location you are currently in. You have to run the git init command in a folder in order to connect it to GitHub. This is one of the first commands you run when creating a new directory that you want to share; or if you have a file or folder you want to monitor with version control, for example.
  • Git clone

    This command clones a GitHub repository to your local machine. When you are looking at a repo, copy the HTTPS link and run git clone and then the address. Example: git clone https://github.com/gregheffner/homepage.git After you run this, it will download the files to your machine so you can interact with them as you need.
  • GitHub clone command example
    Top right, you will see the git clone command already typed out for you. You just need to copy the text. Greg GitHub HomePage
  • Git add / Git commit

    These commands save or commit your work and when you also give the git commit command a -m flag, you can put a comment on what you did and why you did it. For example, if you had a text document that had your name in it but it was misspelled, you can make the edits in the document. Git add the file with the edits. Then add the comment git commit -m "changed name spelling" this will add the note on the commit so you can reference edits or changes. You can use these messages to reference ticket numbers if you're fixing something, brief change notes, or any text you can put in with a 72 character limit. Just make it easy for anyone to read. You don't want to have a note that's unidentifiable to someone who may need to know what has changed without having to dig into the code too much.
  • Git push

    This is how you upload the code or changes you made to code to GitHub. If you make changes on a file and don't push them, then only you can see those changes and there is no collaborating on scripts unless the other person has local access to the files.
  • Git pull

    This will download any changes to code you have already cloned. If you make changes to a file on one computer and push them to GitHub, you have to git pull those changes on the other computers to get the latest updates. GitHub will not pull the latest update on its own. This keeps the code or project you are working on in the exact same state as you left it until you pull the updates. Be careful though, don't make any changes to files that are not up to date with the latest GitHub version of the files or you will have problems pushing your changes in the future.

Understanding these five commands will give you a basic understanding of GitHub. Having a place to store your projects, codes, or scripts other than on your local computer is always a good thing. Yes, people have backups and USBs and search engines, but this does not help you when you need to work on something on a new computer or on a replacement device when you're in a pinch. I highly recommend someone who is new to GitHub to create an account and upload a file with "Hello World" written in it. I learn best by doing and repeating. I'm very hands-on. Once you are comfortable, clone someone else's repository to test. You don't even have to run the code; you can delete it after. Just get your feet wet. It's nice in here.

If you would like a good reference to have when youre getting started, check out Git CheatSheet

A good video explaing Git in detail Git for Beginners. GitHub Developer Advocate Kedasha Kerr guides you through everything you need to know to get started and be successful with Git and GitHub.

I invite you to check out my personal GitHub repo and the Popular Projects section in this blog for some intresting builds.

AI response

I received a lot of feedback on my last article saying how much people liked the Bing AI story about Pi-Hole. So here's another one from Bing AI. Thanks everyone for reading. Feel free to send me suggestions by using the contact link at the top.

GitHub is like a special place where programmers and software developers share their secret codes. Imagine it as a magical treehouse where they hang out?

Here's how it works:

  • Code Storage: GitHub is where they keep their code safe. It's like a treasure chest for their computer spells (code).
  • Collaboration: They invite their friends (other developers) to play in the treehouse. Together, they build cool projects, like building a dragon-catching net or creating a rainbow potion.
  • History Book: GitHub remembers every change they make. If they accidentally turn a frog into a pumpkin, they can go back to the old frog version.
  • Show and Tell: They proudly show off their magical spells (code) to others. It's like saying, “Look, I made this flying broomstick!”

So, GitHub is where wizards (developers) share their spells, learn from each other, and create amazing things!

About Me

I served in the U.S. Army, specializing in Network Switching Systems and was attached to a Patriot Missile System Battalion. After my deployment and Honorable discharge, I went to college in Jacksonville, FL for Computer Science. I have two beautiful and very intelligent daughters. I have more than 20 years professional IT experience. This page is made to learn and have fun. If its messed up, let me know. Im still learning :)

Weather Loop