"

Installing and Configuring Git

Lecture: Installing Git on MacOS

Lecture: Configuring VSCode with Git

Download Git – Visit this website to download Git for your operating system.

Choose your operating system and download the latest stable release.

image

Downloading Git for MacOS

Click on macOS. It should take you to a page with instructions for installing Git.

image

Open a terminal by pressing “Command + Space” and type “terminal”. Choose the application named Terminal.

image

If you don’t already have it, install Homebrew by copying the line of code on the Homebrew site. Paste it into the terminal and press enter. If you don’t know if you have it or not, try installing Git and if it fails, install Homebrew.

image

Don’t forget to run the commands given by Next Steps after Homebrew is installed.

image

Install Git by running brew install git

image

Run git on the command line to ensure it was installed successfully.

To run git, type git and press enter.

image

If git runs, you’re done! If not, make sure you installed Homebrew correctly, including adding brew to your PATH.

Downloading Git for Windows

After the installer downloads, run the installer. Click Next.

image

The default path is fine. Click Next.

image

If you want a Desktop Icon, check the box next to “On the Desktop”. You won’t really need to run the Git GUI, so you probably won’t directly run this program. You likely won’t need the icon, but that’s up to you.

If you want to be able to right click and see “Open Git Bash” or “Open Git GUI” from the file explorer, check the boxes next to

Windows Explorer integration

Open Git Bash here

Open Git GUI here

Make sure to check the boxes next to

Git LFS

Associate .Git* configuration files with the default text editor

Associate .sh files to be run with Bash

Add a Git Bash Profile to Windows Terminal

Uncheck the box next to

Scalar (Git add-on to manage large-scale repositories)

Click Next.

image

image

Choose what you want to name the shortcuts in your Start Menu or click “Don’t create a Start Menu folder” if you don’t want the shortcut. Click Next.

image

Choose “Visual Studio Code as Git’s default editor”. Click Next.

image

Either of these options is fine. Traditionally, your main branch on Git is named the “master branch”. Branches are how you test out features; you switch branches to make a copy of the code to toy around with features without breaking the main build. When your feature is ready, you merge it back onto the “master branch”. However, recently, this has come up as perhaps inappropriate, and so Git is working to rename it.

If you want to rename your main branch now, choose the second option. If you want to leave it until Git officially renames it, choose the first option. Either option is fine.

Click Next.

image

Choose “Git from the command line and also from 3rd-party software”. You need to check this so that VS Code can access Git.

image

Choose “Use bundled OpenSSH”. Click Next.

image

Choose “Use the OpenSSL library”. Click Next.

image

Choose “Checkout as-is, commit Unix-style line endings”. This helps preserve formatting when getting code to and from GitHub. Click Next.

image

Choose “Use MinTTY”. Click Next.

image

Choose “Only ever fast-forward”. Click Next.

image

Choose if you’d like to use the Credential Manager. I’m only connecting VSCode with GitHub, so I don’t need it. You can always reinstall to add features if you find out that you do need it later. Click Next.

image

Check both boxes. Click Next.

image

Uncheck both boxes. Click Install.

image

You’re all done! You don’t need to launch Git or view the release notes unless you want to. Click Finish.

image

Git is installed!

License

Icon for the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Computer Science II Copyright © by Various is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, except where otherwise noted.