Git and GitHub setup

Setting up Git and GitHub utilities

Git is the world’s most popular version control system. GitHub is a cloud service that hosts shared code repositories.

We will setup these and then delve further.

Git installation

Git is available for all operating systems. We will install for WSL/Linux and Mac.

Git is bundled with the XCode Command Line Tools, which you may already have on your Mac. Open a Terminal and run:

git --version

If you don’t have it installed already, it will prompt you to install. If you do have it installed, you will see something like git version 2.39.5 (Apple Git-154).

sudo apt update  # You will be prompted to enter your login password
sudo apt install git-all
  

Git configuration

Close any open Terminals. Run the following in a new Terminal.

git config --global user.name "John Doe"  # Put your real name
git config --global user.email johndoe@example.com  # Put a permanent email here
git config --global core.editor "code --wait"  # Use Visual Studio Code as the editor for commit messages.

You only run these once when you install Git.

GitHub set up

We will use GitHub in this class to remotely store versions of our code. Many organizations use GitHub to store their code, including many popular open source projects.

Use a permanent, personal email account to register for a free GitHub account at https://github.com. You will eventually lose access to your UNCW email, but you will want to access your GitHub account long after you graduate.

That’s all you need to do for now. We will use GitHub soon.

Last modified October 21, 2024.