Git and GitHub Intro

Introduction

Coders are human, and as such, we make mistakes. Frequently. We also want to try new things that might not work, but don't want to mess up a program that is already functioning. This is where version control comes in handy. Among other things, version control allows you to rollback changes you make that you don't like. Version control systems (VCS) are essential to software and web development, and Git is by far the most commonly used VCS.

GitHub is related to Git. It is an online repository and internet hosting service that allows you to share your work (your Git repositories) and collaborate with others.

To get started learning Git and GitHub, we'll be using the Git-it desktop app created by Jessica Lord that teaches the basics of using Git on the command line. So all of your hard work learning the command line in the past module will prove useful now!

Choose the Git-it download below that matches your operating system:
Download for Mac
Download for Windows
Download for Linux

Now find Git-it in your Downloads directory, unzip the folder and run the Git-it executable file, Git-it.exe. To run it on Windows and Linux, just double click Git-it.exe. To run it on a Mac, right click Git-it.exe, select Open and then Open again. If you have file extensions hidden in your file manager, then look for the file named "Git-it" that features an icon.

Exercises

Since you've already installed Git, you can skip the first step, "Install Git", in the first challenge, "Get Git". Go directly to the second step in that challenge, "Configure Git" and continue on from there. Work through all the challenges in the Git-it application and you'll be ready to move on to learning Markdown. Once you've learned some Markdown, you can combine that with your knowledge of Git in order to create your very own resume on GitHub!

Learning Objectives for Git

Just as with the command line module, there are many useful commands you will learn in this Git module, but some commands will be used with greater frequency in your programming career than others. Here is a list of the git commands you should focus on in this module:

Constantly Used:

  • git status
  • git diff
  • git add <fileName> and git add . (the latter adds all files)
  • git commit -m "Your Commit Message Here"
  • git push
  • git pull

Frequently Used:

  • git init
  • git remote add origin <urlFromGitHub>
  • git clone <urlFromGitHub>
  • git merge
  • git fetch
  • git branch <branchName> (creates a branch)
  • git checkout <branchName (checks out a branch)
  • git checkout -b <branchName> (creates a branch and checks it out)

Reminder

Be sure to check out the Resources page for more Git learning tools and cheatsheets!

Back to Git and Markdown Menu