Also see GitHub

Git is a popular, collaborative version-control software (VCS) used to track changes in a project, and make it easy for multiple people to work on it at once. It is the underlying software for the code-hosting platform GitHub.

Configuration

  1. Install Git from the official website. On Windows, use the recommended options, and make sure to select “Git Credential Manager Core” when it appears.

  2. Open a terminal (or Git Bash on Windows), and run git -v to check if Git was installed (it should respond with a version number.

  3. Configure Git

    1. Setup your username and email by running these commands:

      git config --global user.name "Firstname Lastname"
      git config --global user.email "[email protected]
      
    2. Set your default editor. This is where you will edit commit messages and make other changes in Git. Below are commands for some common editors (more here, add the --global flag):

      git config --global core.editor "vim" # VI Improved, terminal editor
      git config --global core.editor "emacs" # EMACS, terminal editor
      git config --global core.editor "code --wait" # Visual Studio Code, GUI text editor
      
    3. Optionally setup these other useful configuration commands:

      git config --global init.defaultBranch "main" # New repos will use a branch called "main" by default
      git config --global pull.ff "only" # Pulling remote changes will not create new commits, helps to avoid unexpected changes
      git config --global help.autoCorrect "prompt" # A new feature that asks if you want to rerun a misspelled command
      
  4. Go to the GitHub onboarding page and setup your GitHub account, then come back here.

  5. Authorize your local install with GitHub. Instructions for both methods can be found in the GitHub documentation.

    <aside> ⚠️ SSH authentication uses addresses in the SSH format of user@server:path/to/target You should reformat commands for remote repositories into this format.

    Rarely, a network will block SSH connections. In these cases, you should use HTTPS as described below.

    </aside>

  6. Check out these learning resources if you’re new to the world of computer programming.

    Programming Basics Collection

    Git Tutorial for Beginners: Command-Line Fundamentals

Resources