✌️Required Software 2

Required Command-Line Software: Git

Intro to Git

Command-line software is software primarily operated from the command line (we will explain this in a video) that may not have a graphical user interface we can interact with. This software is typically used by software developers to write programs. Command-line software is not stored in a computer's Applications folder. We'll cover more about the command line in 1.3.

Git is the most popular software version control system. All tech companies use version control to manage contributions to and releases of their software. We will be using basic Git during CodiSWE Fundamentals to download and upload copies of projects. We'll cover more about Git in Module 7.

On Windows, Git installation also enables us to run our terminal in the Bash programming language. The terminal is the program that allows us to run commands (and command line software) on our computers. Bash is a terminal language used across OSes, allowing us to run commands on our computers in the same way on both Windows and Mac. A version of Bash called Zsh (pronounced "zoosh") is installed by default on MacOS.

When copying any commands from the Git website, do not copy the dollar sign ($) in front of the command. The dollar signs in their commands denote the start of command lines, and are not part of the commands.

Git - Installation

Installing Git for Mac OS

  1. Download and install Git for Mac OS by downloading it here: https://sourceforge.net/projects/git-osx-installer/

  2. Verify Git is installed by running git --version in the VSCode terminal. This should print out a version number on the next line, e.g., git version 2.28.0.

  3. Download and install the Git Credential Manager.

To install the Git Credential Manager you may need to allow "unidentified developer apps". (But don't worry, Git Credential Manager is created by Microsoft) from instructions here:

To override your security settings and open the app, follow these steps:

  1. Control-click the app icon, then choose Open from the shortcut menu.

  2. Click Open. __

    The app is saved as an exception to your security settings, and you use it in the future just as you can any registered app. __

Note: If you are using a company computer for this course you may not be able to override the security settings- you may need to create a personal token as described here.

Installing Git for Windows

  1. Navigate to the Git website download page and click the download link: https://git-scm.com/download/win

  2. Open the downloaded file.

  3. The Git install dialog will open. We'll need to set a few options here. The rest will be the default options.

  4. Follow command line setup instructions below to set Bash as the terminal language.

  5. Verify Git is installed by running git --version in the VSCode terminal. This should print out a version number on the next line, e.g., git version 2.28.0.

VSCode Formatters

Prettier

Prettier is a code formatter that will auto-format our code and make it more readable when we save our files.

  1. Install the Prettier extension for VSCode here.

  2. Restart VSCode to activate Prettier.

VSCode Formatting Settings

  1. Open VSCode and open the command prompt with Ctrl+Shift+P on Windows and Cmd+Shift+P on Mac.

  2. Start typing Preferences: Open User Settings (JSON) and select this option when you see it in the search dropdown. A JSON settings file should open in VSCode.

  3. Replace everything on the screen (in the file) with the code below.

  4. Save the settings file.

  5. Restart VSCode to apply our settings.

  6. Open and save the settings file again and verify that Prettier auto-formats it as our default formatter.

VSCode Settings

VSCode Settings - Mac OS

{
	"editor.formatOnSave": true,
	"editor.formatOnPaste": true,
	"editor.minimap.enabled": true,
	"editor.tabSize": 2,
	"editor.wordWrap": "on",
	"editor.defaultFormatter": "esbenp.prettier-vscode"
}

Required Software Accounts

GitHub

GitHub is the most popular code-hosting platform. Developers around the world use GitHub to share code and collaborate on projects. Rocket Academy's starter code and project templates are hosted on GitHub, and we will use GitHub in SWE Fundamentals to download, host, and submit assignments. Each student will need a GitHub account to host and submit assignment code.

Sign Up

Go to https://github.com/, click the Sign Up button and follow on-screen instructions.

Git and GitHub Credential Configuration

Add your GitHub account credentials to your computer through the command line. Please replace <YOUR_GITHUB_USERNAME> AND <YOUR_GITHUB_EMAIL> with your own GitHub user name and the email you used to sign up to GitHub with. Note to replace the <> characters and keep the " characters in the commands.

git config --global user.name "<YOUR_GITHUB_USERNAME>"
git config --global user.email "<YOUR_GITHUB_EMAIL>"

Configuration Check

You will not get any feedback from the terminal after entering these commands.

Type the following command into the terminal to check your work. If you see a : at the bottom of the output, you may need to press Enter until you see the lines starting with user.name and user.email.

git config -l

You should see your username and email in the output, and possibly some other settings.

Git default branch configuration

Following the convention of all the other Rocket Academy Git repositories and GitHub, we'll change the default Git branch name by typing in the command shown in the code box.

git config --global init.defaultBranch main

Exercise: Send Your First Slack Message!

Introduction

Once you have been added to a section in Slack, send your first message to your new section mates. Please include the following in your message:

  1. Where are you based?

  2. What do you do for work?

  3. Why do you want to learn coding?

  4. 4 emojis that describe you

  5. Your specific OS version. This will be the result of running the command below for your specific OS (Windows or Mac)

  6. Anything else you would like to share 😁

Retrieve Your OS Version

These commands are for the intro above. Don't worry about exactly what's happening in these commands yet. This exercise is just to get you started with typing in the Command Line interface and sending Slack messages. We'll learn more about the command line in 1.3 Command Line.

Windows

cmd /c ver

Mac

sw_vers

Last updated