Git is a DevOps tool for source code management—an open-source version control system (VCS) used to handle small to very large projects efficiently. Git is used to tracking changes in the source code, supporting non-linear development so that multiple developers can work together in near real-time.
In this Git setup on Windows article, you will find a step-wise guide to Git installation on Windows. Let’s get started.
Git Installation on Windows
Let us now look at the various steps in the install git:
Download the latest version of Git and choose the 64/32 bit version. After the file is downloaded, install it in the system. Once installed, select Launch the Git Bash, then click on finish. The Git Bash is now launched.
Check the Git version:
|$ git --version
For any help, use the following command:
|$ git help config
This command will lead you to a browser of config commands. Basically, the help the command provides a manual from the help page for the command just following it (here, it's config).
Another way to use the same command is as follows:
|$ git config --help
Create a local directory using the following command:
$ mkdir test
$ cd test
The next step is to initialize the directory:
|$ git init
Go to the folder where "test" is created and create a text document named "demo." Open "demo" and put any content, like "Hello Simplilearn." Save and close the file.
Enter the Git bash interface and type in the following command to check the status:
|$ git status
Add the "demo" to the current directory using the following command:
|$ git add demo.txt
Next, make a commit using the following command:
|$ git commit -m "committing a text file"
Link the Git to a Github Account:
|$ git config --global user.username
Note: simplilearn-github is the username on the Github account.
Open your Github account and create a new repository with the name "test_demo" and click on "Create repository." This is the remote repository. Next, copy the link of "test_demo."
Go back to Git bash and link the remote and local repository using the following command:
|$ git remote add origin <link>
Here, <link> is the link copied in the previous step.
Push the local file onto the remote repository using the following command:
|$ git push origin master
Move back to Github and click on "test_demo" and check if the local file "demo.txt" is pushed to this repository.
Additional Customization Options
- This option enables users to add extra elements such as symbolic links for command lines. Nevertheless, one should always prefer default options for shortcuts or more.
- There are some experimental options available such as pseudo control Support or Built in file system monitor concerning your installed Git version.
How to Launch Git in Windows?
There are two methods to launch git in windows. One is launching git using a bash scripting shell with the help of the command line and another is launching git using a graphical user interface.
- To launch git via bash scripting shell,
First, open the window and search for git bash and open it.
- To launch git via graphical user interface(GUI), similarly, first open the window and search for git GUI and click on the application icon and open it.
Configure GitHub Credentials
You can configure your local GitHub installation with credentials by using the following commands. Also, don't forget to add your own GitHub credentials for username and email address.
- git config –global user.n
- git config –global user.e
Clone a GitHub Repository
- Initially you need to click the options repository on GitHub.
- Then in the top right corner, click the option clone or download where a small drop-down box will appear having a URL for cloning over HTTPS.
- Then enter into your Powershell windows and write clone URL as:
git clone repository_url
- On the other hand, you can clone a github repository with SSH URLs where first you need to generate an SSH key pair on your windows workstation as well as need to assign a public key to your GitHub account.
List Remote Repositories
- Make a copy of the repository from GitHub for your working directory.
- Ensure that the working directory should have the project name as
"cd git_project" and replace the project name from the downloaded repository.
- If the above option doesn't work, you can list the content using "ls command" for the current directory, especially to check your exact number of spellings.
- Besides, you can list the remote repository in the sub-directory as "git remote -v".
Summary: Steps For Git Installation on Windows 10
- Download and install Git
- Git bash interface
- Basic Git commands
- Create a local repository
- Connect to the remote repository
- Push the file to GitHub
Choose The Right DevOps Program For You
This table compares various DevOps programs offered by Simplilearn, based on several key features and details. The table provides an overview of the courses' duration, skills you will learn, additional benefits, among other important factors, to help you make an informed decision about which course best suits your needs.
Program Name DevOps Engineer Masters Program Post Graduate Program in DevOps Geo All All University Simplilearn Caltech Course Duration 11 Months 9 Months Coding Experience Required Basic Knowledge Basic Knowledge Skills You Will Learn 40+ Skills Including Ansible, Puppet, Chef, Jenkins, etc. 10+ Skills Including CI,CD, DevOps on Cloud, Deployment Automation, etc. Additional Benefits Masters Certification
Real Life Projects
Learn 40+ Skills and Tools
Caltech Campus Connect
Masterclasses by Caltech Instructors
Cost $$ $$$ Explore Program Explore Program
Become a DevOps Expert
Are you preparing for a career in DevOps? Check out Simplilearn's DevOps Engineer Master's Program or the Post Graduate Program in DevOps that bridges the gap between software developers and operations. You can become an expert in the principles of continuous development and deployment, automation of configuration management, inter-team collaboration, and IT service agility, using modern DevOps tools such as Git, Docker, Jenkins, Puppet, and Nagios. DevOps jobs are highly paid and in great demand, so start on your path today.
1. How to install Git for Windows 10?
You can install Git for Windows 10 by downloading the installer from the official Git website, then following the step-by-step instructions in the setup wizard.
2. How to install Git in Windows in CMD?
While Git can't be directly installed from CMD, you can use it to check your installation by typing "git --version". If Git is installed properly, the command should return the current version.
3. How to install Git and clone a repository in Windows?
First, install Git from the official website, then open your command prompt, navigate to your desired directory, and use the command "git clone [repository URL]" to clone your repository.
4. Can I run Git on CMD?
Yes, once Git is installed on your system, you can execute Git commands through Windows Command Prompt (CMD).
5. How to install Git repository with pip?
Pip is a package installer for Python, not Git. However, you can install a Python package from a Git repository by using the command "pip install git+[repository URL]".