GitHub – How to Download? Install Git in Windows
Introduction
Among the DevOps tools, Git is one of the most popular and widely utilized tools. Git serves as an open-source version control system that can be employed for free. It typically helps in source code management and handling projects efficiently regardless of their sizes. Moreover, you can also track modifications in the source code while working alongside multiple developers on any non-linear development with the help of Git. In this article, we will take you through the tutorial that explains how you can download and install Git for Windows. Plunge into the sections below and grab all the required insights.
Requirements
Before you begin to know further about how to install GIT, ensure that you fulfill the following prerequisites –
- You must possess administrator privileges.
- You must have access to a command line.
- You must have your favorite coding text editor running.
- You should obtain a username and password for the Github website. Although, this can be optional.
Git Installation Process for Windows
When you begin to install Git Windows, you will be prompted to pick a text editor. Thus, if you do not already have one in your system, we firmly advise you to install the preferred text editor prior to moving forward towards installing Git.
Note – If you are a newbie when it comes to Git, you must first discover and understand enough about Git workflow and functions.
Following below are the complete steps to install Git successfully for your Windows operating system. Let us go through them thoroughly!
Download Git for Windows
Step 1: Firstly, you need to browse the official website of Git – https://git-scm.com/downloads.
Step 2: Click on the link that makes you download Git for Windows. And wait till the download is completed.
Extract and Launch Git Installer
Step 3: Go to the location where the Git setup gets downloaded or you can employ the download shortcut in your browser. Double-click the setup file. This will extract and launch the respective installer.
Step 4: Give permission to the app for making changes to your device. This will be done by clicking ‘Yes’ under the User Account Control dialog that pops up.
Step 5: Read the GNU General Public License that pops up on your screen and, once you are ready to install, click Next.
Step 6: Further, you need to provide the installation location to the installer. Or, you can go with the default location and click Next.
Step 7: When the component selection screen appears, you can either go with the defaults or change them as per your needs and click Next.
Step 8: The installer will provide you the option to create a start menu folder and, you can then simply click Next.
Step 9: Choose the text editor you wish to employ with Git with the help of the drop-down menu and click Next.
Step 10: This step lets you pick a different name for your initial branch and by default, you will find it ‘master.’ You have a choice of either continuing with the default name or changing it. Afterward, click Next.
Step 11: In this step, you get the option of changing the PATH environment. You can leave this on the middle (recommended) selection and click Next.
Server Certificates, Line Endings and Terminal Emulators
Step 12: You need to inform the installer about which SSH client you wish Git to utilize. Since Git comes with its own SSH client as well, you can go with the default choice if you do not require any specific one and click Next.
Step 13: The next thing that comes up is the selection of server certificates. In case you are operating in an Active Directory environment, you may have to pick the Windows Store certificates. Otherwise, you can use the default one and click Next.
Step 14: Now you will be prompted to convert line endings. It is suggested to go with the default selection as this is associated with the way data is formatted. Modifying anything in this option can cause problems for you. So, Click Next.
Step 15: Select the terminal emulator you wish to utilize. Based on the features, the default MinTTY is suggested. You can click Next after choosing.
Step 16: You will be asked what the Git pull command should do. You should go with the default option unless you are particularly required to change its behavior. Then, click Next in order to continue with the installation.
Step 17: Choose the credential helper you desire to employ. Git utilizes credential helpers for fetching and saving credentials. You can go with the default option and click Next.
Additional Customization Options
Step 18: It is suggested to go with the default options. However, you can enable additional option(s) as per your necessities. Then, click Next.
Step 19: This step will prompt you to install experimental features depending on the version of Git you are installing. If you have no requirement of such features, leave all the options unchecked, and at last, click Install.
Complete Git Installation Process
Step 20: After completion of the Git installation, you can tick the boxes in order to view the Release Notes or Launch Git Bash, then click Finish.
How to Launch Git in Windows?
Git holds two modes of usage – a bash scripting shell (or command line) and a graphical user interface (GUI).
Launch Git Bash Shell
For launching Git Bash, go to the Windows Start menu, type git bash, and press Enter or, you can also click the application icon.
Launch Git GUI
For launching Git GUI, go to the Windows Start menu, type git gui, and press Enter or, you can also click the application icon.
Connecting to a Remote Repository
To follow the steps below to connect to a remote repository, you must have a GitHub username and password.
Create a Test Directory
First, you need to open a Windows PowerShell interface by pressing Windows Key + x, and then i once the menu pops up.
Build a new test directory (folder) by entering the command as –
mkdir git_test
Then, change your location to the newly built directory with the help of a command –
cd git_test
Note: In case you already hold a GitHub repository, employ the name of that project rather than git_test.
Configure GitHub Credentials
Now, you can configure your local Git installation for utilizing your GitHub credentials by entering the commands as –
git config --global user.name "github_username"
git config –global user.email “email_address”
Note: You are supposed to replace github_username and email_address with your GitHub credentials.
Clone a GitHub Repository
Next, you visit your repository on GitHub. At the top right above the list of files, you need to open the Clone or, you can also download the drop-down menu. Copy the respective URL in order to clone over HTTPS.
Now, you can switch to your PowerShell window, and enter the command as –
git clone repository_url
Important: In the instance provided above, the command clones the repository over HTTPS. On the other side, you can also clone with SSH URLs. For this, you need to develop an SSH key pair on your Windows workstation. And, then you must allocate the public key to your GitHub account.
List Remote Repositories
The next step is to ensure that your working directory has a copy of the repository from GitHub. It should possess a directory that is of the name of the project. Shift to the directory with the help of a command –
cd git_project
Note: You are supposed to replace git_project with the real name of the repository you downloaded. In case it does not function, you can use the Is command to list the contents of the current directory so that you can discover the exact name or verify the spelling.
After you are in the sub-directory, you can list the remote repositories by entering the command-
git remote -v
Pushing Local Files to the Remote Repository
When you get to do some work on the project, you may require to submit the additions or modifications to the remote project on GitHub.
1. For instance, build a new text file by entering the below command into your PowerShell window –
new-item text.txt
2. After entering the above command, your screen will provide you with the output confirming the creation of the new file.
3. Next, inspect the status of your new Git branch as well as untracked files with the help of command –
git status
4. The, append your new file to the local project by entering the command –
git add text.txt
5. At this step, you are supposed to run Git status again to ensure the addition of the text.txt file. Next, you can save the changes to the local project –
git commit -m "Sample 1"
6. In the end, you can push the changes to the remote GitHub repository by entering the command as –
git push
Also, you may have to enter your username and password for GitHub.
Note: You can discard a remote repository if there is no requirement.
Also Read: How to Enable or Install Telnet on Windows 10 or 11?
Conclusion
After following this tutorial appropriately, you can easily download GIT for Windows and run a working installation of Git on your system. Further, you must attempt to keep your Git installation up-to-date always. Also, you are welcome to reach out to us in case you encounter any issues or problems while downloading or installing Git for the Windows operating system.