How to Install and Use Git for Beginners (Complete Step-by-Step Guide)
1. What is Git? (Explained Super Simply)
Git is basically:
-
A tool that saves versions of your project
-
A time machine for your code
-
A safety system to avoid losing files
-
A collaboration tool used by all professional developers
Think of Git as “Google Drive for programmers—but smarter.”
You don’t need to be a genius to learn Git. You only need small steps, which we’ll take together.
2. Step 1 — Download Git
To install Git, follow these beginner-proof instructions:
For Windows
-
Click Download for Windows
-
Open the installer (
.exe) -
Keep clicking Next (default settings are okay)
-
Click Install
-
Wait until it finishes
For macOS
-
Open Terminal
-
Run this command:
-
Or download Git from git-scm.com
For Linux (Ubuntu / Debian)
Just run:
simply !. Done.
3. Step 2 — Check Git Installation
Open Terminal or Command Prompt and type:
If you see something like:
…you’re ready for the next step!
4. Step 3 — Configure Git (Important for GitHub)
Git needs to know who you are so it can attach your name to your work.
In your Terminal, type:
What this does
-
user.name→ Your identity -
user.email→ Links your commits to GitHub
Make sure the email matches your GitHub email if you want commits to show on your profile.
5. Step 4 — Create Your First Git Project
Now let’s create your first project (repo).
-
Create a new folder
-
Open it
-
Right-click → “Open Terminal here”
-
Run:
You just created your first repository.
Congratulations — you’re officially using Git!
6. Step 5 — Add a File to Git
Inside your new folder, create a file:
hello.txt
Add some text inside it:
Now tell Git to track this file:
This means “Git, please watch this file.”
7. Step 6 — Commit Your File
Now save this version in Git:
This is like saving a snapshot of the file.
For beginners:
-
A commit = a saved version
-
-m= message describing what you saved
8. Step 7 — Create a GitHub Account (If You Haven’t Already)
Visit:
https://github.com/
-
Sign up
-
Choose a username
-
Verify your email
GitHub is like the cloud storage for your Git projects.
9. Step 8 — Create a New GitHub Repository
On GitHub:
-
Click the + button
-
Select New repository
-
Name it (example:
my-first-git-project) -
Click Create repository
GitHub will show you instructions — but don’t worry, we’ll do it step-by-step.
10. Step 9 — Connect Git to GitHub
In your Terminal, copy the GitHub command:
Replace:
-
USERNAME → your GitHub username
This connects your computer to GitHub.
11. Step 10 — Push Your Project to GitHub
Finally, upload your project:
If you get asked for login:
-
Enter GitHub username
-
Enter GitHub personal access token (GitHub password is no longer supported)
After pushing, refresh your GitHub page — your file is now online!