Key Tool Preparation (2) – Windows
Preparing the Git environment in Windows is slightly complex. You need to install the Git software with several initial settings. For Windows, Powershell is usually used as a command line, but Git provides a Unix-based command line called Git Bash. In this course, we assume that Windows users are using Git Bash. For the text editor, we use VS code as an example. You can open Git Bash using VS code so that you can use a command line and text editor in the same application.
The choice of a web browser is less critical. For our demonstration purposes, we use Chrome when we explain with examples.
On this page, we'll explain how to install the latest Git software onto a Windows computer and prepare VS code as a text editor with Git Bash in the VS code window.
1. Install Git
To install Git onto Windows computer, follow the steps below.
Download Git installation package
Go to this site Git download for Windows and click on "Click here to download".
The Git installation package will be downloaded onto your computer.
Open the downloaded .exe file and follow the installation instructions.
First, you'll be asked to allow the app to make changes to your device. To start the installation process, click on Yes.
Once the installation process is initiated, you'll need to confirm many initial settings.
Click on the Next buttons in the following pop-up windows. You can also click on the Next button for the default editor setting without changing the selection. We can change the default editor to Visual Studio Code later.
For the initial branch name setting, you can change the default branch name to main; however, for practice purposes and to avoid complexity, select the first option. Continue clicking on the Next buttons in the following pop-up windows.
Finally, click on the Install button.
Check Launch Git Bash and click on Finish.
You can check what Git Bash looks like.
2. Install VS Code
VS Code is available on VS Code official homepage. Here are the steps to install VS Code on Mac.
Go to the official site. Select Windows to download VS Code.
Open the downloaded .exe file and follow the installation instructions.
After opening the downloaded .exe file, agree to the software license.
Click on the Next buttons again in the following pop-up windows.
For the additional tasks, check all the items so that you can open VS code in various ways.
Click on the Install button and complete the installation.
3. Set Git Bash as the default command line and open it in VS Code
Set Git Bash as the default command line
As Git Bash is not a default command line for Windows, you need to check the settings.
In the VS code window, click on the settings icon at the bottom left corner and select Settings.
Type terminal.integrated.default profile: windows. and select Git Bash in the drop-down list.
Open Git Bash in VS Code
To open Git Bash in the VS code window, click on Terminal in the top menu bar and select New Terminal.
You can see that Git Bash is opened at the bottom of the VS code window.
Windows Settings
If you are using Windows, it's helpful for you to know how to show extensions as well as hidden files and directories.
To show them, open Windows Explorer and check the following items on the top bar (Ribbon).
- File name extensions
- Hidden items