how to install and setup git
requirement ? initial expectation ? final result ?
requirement: git --version
should display installed version on the system
initial expectation: command git
not found
final result: git version 2.34.1
what the git ?
chillx, git is a free, open source and easy to use distributed version control system
installation
visit official git website and follow below setup steps as per your system os
linux
0. run git --version
in terminal (if it displays git version, skip to step 4)
- update local package index
sudo apt update
what the apt
? chillx, apt
is advanced package tool is a package management tool used in debian and ubuntu based systems for installation and removal of software packages.
sudo apt update
neither installs nor upgrades any packages, it just retrieves latest information of available packages from repositories.
2. install git via apt
sudo apt install git
3. check if git is installed
4. enjoy
macos
0. run git --version
in terminal (if it displays git version, skip to step 4)
- install brew, if you haven't already
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2. install git from brew
brew install git
3. check if git is installed
git --version
4. enjoy
windows
-1. switch to linux ( :) )
0. run git --version
in terminal (if it displays git version, skip to step 4)
- download .exe file from here based on your system (32 or 64 bit)
2. follow steps as mentioned in installer, click on next, keep everything default as you might not need to change anything default
let it extract
enable “launch git bash” checkbox and click on finish, it will open git bash for you
3. check if git is installed
git --version
4. enjoy
setup
once git is installed on to your machine, set your git user name and email
git config --global user.name "Vishnuprakash P"
git config --global user.email "Vishnuprakash.P@example.com"
you can check if everything was ok by running below command,
git config --global --list