Total Pageviews

Search This Blog

Copyright to Cloud TechNet organization . Powered by Blogger.

Pages

Blogger templates

Monday, 20 February 2023

How to configure environment variables for Git services in windows systems ?


 To configure environment variables for Git services in Windows systems, you can follow these steps:

  1. Open the Start menu and search for "Environment Variables".

  2. Click on "Edit the system environment variables".

  3. In the System Properties window that appears, click on the "Environment Variables" button.

  4. In the Environment Variables window, locate the "Path" variable under the "System Variables" section and click the "Edit" button.

  5. Click the "New" button and add the path to the Git installation directory, which should be something like "C:\Program Files\Git\bin".

  6. Click "OK" to close all the windows.

  7. Open a new command prompt or PowerShell window, and type "git" to verify that Git is now recognized as a command.

That's it! You have now configured the environment variables for Git in your Windows system. This will allow you to use Git commands from any directory in your system, without having to specify the full path to the Git executable every time.

Git basic commands


 Here are some basic Git commands that you can use to manage your code repository:

  1. git init: Initializes a new Git repository in the current directory.

  2. git clone <repository_url>: Clones an existing Git repository from the specified URL.

  3. git add <file_name>: Adds the specified file to the staging area.

  4. git add .: Adds all modified and new files to the staging area.

  5. git commit -m "<commit_message>": Commits the changes in the staging area to the repository, with the specified commit message.

  6. git push: Pushes the changes from your local repository to the remote repository.

  7. git pull: Pulls the changes from the remote repository to your local repository.

  8. git status: Shows the status of the current branch and any modified or untracked files.

  9. git log: Shows the commit history for the current branch.

  10. git branch: Shows a list of all branches in the repository, with an asterisk next to the currently checked out branch.

  11. git checkout <branch_name>: Switches to the specified branch.

  12. git merge <branch_name>: Merges the specified branch into the current branch.

These are just a few of the basic Git commands. Git has many more commands and options that can be used to manage and collaborate on code repositories.

How to install Git on Windows system ?


Here are the steps to install Git on a Windows system:

  1. Download the Git installer for Windows from the official Git website: https://git-scm.com/download/win

  2. Run the downloaded installer file and follow the prompts in the installer.

  3. In the Select Components screen, leave the default options selected and click Next.

  4. In the Adjusting your PATH environment screen, select the option "Use Git from the Windows Command Prompt" and click Next.

  5. In the Configuring the line ending conversions screen, leave the default options selected and click Next.

  6. In the Configuring the terminal emulator to use with Git Bash screen, leave the default option selected and click Next.

  7. In the Configuring extra options screen, leave the default options selected and click Next.

  8. In the Installing screen, click Install to begin the installation.

  9. Once the installation is complete, click Finish.

  10. To verify that Git has been installed successfully, open a command prompt and run the command git --version. This should display the version number of Git installed on your system.

That's it! Git is now installed on your Windows system and ready to use.

History Of Git ?


Git was created by Linus Torvalds in 2005 as a replacement for the proprietary version control system BitKeeper, which had been used by the Linux kernel development community for several years. When the company that developed BitKeeper changed its licensing terms, the Linux community needed to find a new solution.


Torvalds wanted a version control system that was fast, efficient, and could handle the large codebase of the Linux kernel. He also wanted a system that was decentralized, allowing developers to work on their own local copies of the code and synchronize changes with each other.


The first version of Git was released in April 2005, and it quickly gained popularity within the open-source community. Git's ability to handle branching and merging of code made it particularly well-suited to software development, where multiple contributors may be working on different features or versions of a project simultaneously.


In 2008, GitHub was launched as a web-based hosting service for Git repositories, making it easier for developers to collaborate on open-source projects. Git has since become the most widely used version control system in the world, and is used by many companies and organizations for software development and other projects. The Git project itself is open source and continues to be actively maintained and developed by a large community of contributors.

What is Git ?


 Git is a distributed version control system that allows developers to keep track of changes in their code over time. It was created by Linus Torvalds in 2005 to help manage the development of the Linux kernel.


With Git, developers can work on their own local copies of a project, make changes, and then synchronize those changes with a central repository or with other developers' copies of the same project. This allows for collaboration on a project, as well as the ability to revert to previous versions of the code if necessary.


Git uses a branching system to allow developers to work on different features or versions of a project simultaneously, and then merge those changes back together once they are complete. This can help to keep the codebase organized and make it easier to manage changes made by multiple contributors.


Git has become an essential tool for software development and is used by many companies and open-source projects around the world. There are also many online services, such as GitHub, GitLab, and Bitbucket, that provide hosting and collaboration tools for Git repositories.