Update package lists
First, update your package lists to ensure you have the latest information about available packages:
Install Git
Install Git using the apt package manager:
The
-y flag automatically answers “yes” to prompts during installation.Verify installation
Check that Git was installed successfully by checking its version:You should see output similar to
git version 2.34.1.Next Steps
Now that Git is installed, you can:- Initialize a new repository with
git init - Clone existing repositories with
git clone - Start tracking changes in your projects