Skip to main content

Introduction to GitHub

What is Git, GitHub, and the difference between them?

Git is a version-tracking program, think of it as a shopping list. When you want to remove or add something, simply cross these things out then write down new things. Its simply unecessary to create a new list everytime you want to make changes.

Git keeps track of individual changes rather than a new copy for each one, preventing unecessary use of file space.

While Git keeps a track of these changes, GitHub stores those changes on the internet. This enables team members to see your changes without moving the history from your computer to their computer everytime they need it.

Why use GitHub? Just store files normally.

GitHub makes version managing and collaborating easier.

If you store files on your own computer, anyone who needs that code will have to confront you and transfer these files themselves every time.

Even if you use something like Google Drive or OneDrive, it doesn't allow you to see what the code used to look like. You could make many folders such as Project 0.0.1, Project 0.0.2, and Project 0.1.3 however all the minute details will be lost whenever you forget to upload the new version. Aditionally, this method takes up unecessary resources. Uploading code to a cloud drive not only takes up a lot of redundant file space but also steals your time. When you upload code to a cloud drive, you have to upload every single file, while with GitHub you only upload the small changes.

How do I download Git?

  1. Go to Git's official download page, https://git-scm.com/download/win.

  2. Press the first link on the page, Click here to download. The website should automatically detect which version of Windows you need to use.

  3. Accept the license and press Next.

    A Git menu for accepting their license.

  4. Accept the default configuration and press Next.

    A Git menu displaying which components can be installed.

  5. Open the dropdown and scroll down until you can Select other editor as Git's default editor.

    Git dropdown to select its default editor.

  6. Enter C:\Users\Public\wpilib\2023\vscode\Code.exe as the location of the custom editor. Then press Next.

    info

    Make sure to replace 2023 with the year of your currently installed software.

    warning

    If you install new WPILib season software and have Git integration with your code editor you will need to reinstall Git and change the path to the new editor.

    Git dropdown with default editor set to custom.

  7. Select Override the default branch name for new repositories, then press Next.

    Git menu allowing the default branch name to be changed.

  8. Leave this on the default option, the recommended one, and press Next for all of the following steps.

    Git menu adjusting for the PATH enviornment.

  9. Leave these next settings on the default option and press Next.

    Git menu for SSH. Git menu for HTTPS transport backend. Git menu for lind ending conversions. Git menu for terminal emulators. Git menu for git pull behavior. Git menu for a credential helper. Git menu for extra options. Git menu for experimental options.

  10. Press Install.

    Git menu for installing.

How do I make a GitHub account?

  1. Go to https://github.com/signup.

    Github signup page.

  2. Enter your 202xxxx@scprep.org email, then press Continue.

    GitHub signup page with email.

  3. Create a unique password, then press Continue.

    GitHub signup page with email and password.

  4. Pick a unique username, for example this could simply be your given email, after that press Continue.

    GitHub signup page with a username.

  5. Choose to accept or deny emails from GitHub, I recommended denying these but it is your choice.

    GitHub accept or deny promoitional offers

  6. Complete the given Captcha, then press Continue.

    GitHub signup Captcha

  7. Press Create account.

    GitHub create account button

  8. Enter in the code sent to your email, and your account will be complete.

    GitHub enter code

How do I login to VSCode and Git with my GitHub account?

Requirements

  1. Find the accounts section.

    Accounts section

  2. Select Turn on Cloud Changes....

    Cloud changes button

  3. Select Sign in with GitHub.

    Sign in with GitHub button

  4. Login to your account and press Sign in.

    Sign in button on the web browser.

  5. Open up the terminal in VSCode, the shortcut is (CTRL + `) but you can also use the Terminal > New Terminal at the top.

    A picture of an empty VSCode terminal

  6. Run the following commands and substitute the USERNAME with your GitHub username and the EMAIL with your GitHub account's email (likely @scprep.org). Leave the quotes as is do not remove them.

        git config --global user.name "USERNAME"
    git config --global user.email "EMAIL"

    The end result should look like this: A picture of a VSCode terminal with Git commands.