How to install git using console?
- User
How to install git using console?
- Assistant
Installing Git using the console varies depending on your operating system. Below are the instructions for installing Git on Windows, macOS, and Linux (Ubuntu/Debian and Red Hat/CentOS).
Windows
-
Using Chocolatey: If you have Chocolatey installed, you can install Git by opening PowerShell or Command Prompt as an administrator and running:
choco install git -
Using Git Installer: Alternatively, you can download the installer from the Git for Windows website and install it via the GUI. However, this method is not console-based.
macOS
-
Using Homebrew: If you have Homebrew installed, open Terminal and run:
brew install git -
Using Xcode Command Line Tools: If you don't want to use Homebrew, you can install Git by installing the Xcode command line tools. Run:
xcode-select --installFollow the prompts to complete the installation.
Linux
Ubuntu/Debian
Open your terminal and run the following commands:
sudo apt update sudo apt install gitRed Hat/CentOS
For Red Hat-based systems, use the following commands:
sudo yum install gitFedora
For Fedora, you can use:
sudo dnf install gitVerification
After installation, you can verify that Git is installed by running:
git --versionThis command should return the version of Git that is installed on your system.
Additional Configuration
After installation, it's a good idea to configure your Git user information. You can set your name and email address with the following commands:
git config --global user.name "Your Name" git config --global user.email "your.email@example.com"That’s it! You now have Git installed on your system.
-