The beginner's guide to setting up Git and Node.js on Windows, macOS, and Linux. No experience required — we'll walk you through every single step.
- 🧭 Before You Begin
- 🐙 Part 1 — Install Git
- ⚙️ Part 2 — Configure Git
- 🟢 Part 3 — Install Node.js
- 🔑 Part 4 — Generate an SSH Key
- 🐱 Part 5 — Add Your SSH Key to GitHub
- 🎉 You're All Set!
By the end of this guide, you'll have two essential tools that every developer uses — installed, configured, and ready to go:
| Tool | What it does |
|---|---|
| 🐙 Git | Tracks every change you make to your code — like Google Docs version history, but for entire projects |
| 🟢 Node.js | Lets your computer run JavaScript code outside of a browser |
You'll also connect your computer to GitHub, the world's most popular platform for storing and sharing code.
A terminal (also called a command line, shell, or console) is a text-based window where you type commands to control your computer. It sounds scary — it isn't. Most of the time you're just copying, pasting, and hitting Enter.
Here's how to open yours:
| 💻 Your Computer | How to Open the Terminal |
|---|---|
| 🪟 Windows | Press Win + R, type powershell, and hit Enter — or search "PowerShell" in the Start menu |
| 🍎 macOS | Press Cmd + Space, type terminal, and hit Enter |
| 🐧 Linux | Press Ctrl + Alt + T, or search for "Terminal" in your app launcher |
Tip
Whenever you see a shaded code block like this, it's a command meant to be typed (or pasted) into your terminal. Copy it exactly and press Enter to run it.
Git is a version control system. It keeps a complete history of every change you ever make to your code — meaning you can always roll back to a previous version if something breaks, or collaborate with others without overwriting each other's work.
Think of it as an undo button that never expires and works across your entire project.
The easiest way to install Git on Windows is using winget — a built-in package manager available on Windows 10 and 11.
Open PowerShell and run:
winget install --id Git.Git -e --source wingetNote
This automatically installs the latest version of Git without clicking through any installer menus.
Prefer a traditional installer? Download it directly:
Tip
Not sure if your computer is 32-bit or 64-bit? Almost every Windows machine made after 2010 is 64-bit. When in doubt, pick that one.
After installation, close and reopen PowerShell, then confirm it worked:
git --versionYou should see something like: git version 2.53.0.windows.1
The best way to install Git on a Mac is through Homebrew — a package manager that turns installing developer tools into a single command.
Open Terminal and paste this entire command (yes, it's long):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"The installer will ask for your Mac's login password. Type it in — you won't see any characters appear as you type, and that's completely normal. Press Enter when done and follow any on-screen instructions.
Note
Homebrew installs to /opt/homebrew on Apple Silicon Macs (M1/M2/M3/M4) and /usr/local on older Intel Macs. The installer handles this automatically.
brew install gitVerify the installation:
git --versionYou should see something like: git version 2.53.0
Find the section that matches your Linux distribution and run the command in your terminal. The sudo prefix grants administrator privileges — your system will ask for your password.
sudo apt update && sudo apt install gitWant the absolute latest version? Use Ubuntu's official Git PPA:
sudo add-apt-repository ppa:git-core/ppa && sudo apt update && sudo apt install git# Fedora 22 and later
sudo dnf install git
# Fedora 21 and earlier
sudo yum install gitsudo pacman -S gitsudo zypper install gitsudo apk add git| Distro | Command |
|---|---|
| Gentoo | sudo emerge --ask --verbose dev-vcs/git |
| Mageia | sudo urpmi git |
| Nix / NixOS | nix-env -i git |
| FreeBSD | sudo pkg install git |
| OpenBSD | sudo pkg_add git |
| Solaris 11 | pkg install developer/versioning/git |
Verify the installation:
git --versionGit is installed, but it doesn't know who you are yet. Let's fix that. Git uses your name and email to label your contributions, so when you work with teammates, everyone can see who made which changes.
Important
Use the exact same email address you used (or plan to use) when signing up for GitHub. This is how GitHub links your commits to your account.
Run each of the following commands, replacing the placeholder text with your own info:
Set your name:
git config --global user.name "Your Name"Set your email:
git config --global user.email "your@email.com"Set the default branch name to main:
git config --global init.defaultBranch mainNote
Git traditionally called the main branch "master." The industry has broadly moved to "main." This command ensures every new project you create follows that modern convention from the start.
Confirm everything looks right:
git config --listYour output should look something like this:
user.name=Your Name
user.email=your@email.com
init.defaultbranch=main
Node.js lets your computer run JavaScript — the same language that powers websites — as a standalone program, outside of any browser. It's the foundation of countless developer tools, web servers, and applications.
We're going to install it using a version manager: a special tool that lets you install, update, and switch between different versions of Node.js with a single command. This is the professional approach, and it's easier than it sounds.
NVM (Node Version Manager) is the most popular and well-tested way to manage Node.js on Linux and macOS.
Using curl (recommended):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bashOr using wget:
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bashNote
The install script automatically adds NVM to your shell configuration file (.bashrc, .zshrc, or similar), so it activates every time you open a new terminal.
Close your current terminal window completely and open a fresh one. This step is required — NVM won't be active until you do.
nvm --versionYou should see a version number like 0.40.4. If you see a "command not found" error, try closing and reopening your terminal again.
Install the LTS version — the stable, recommended version for most people:
nvm install --ltsVerify that Node.js and npm installed correctly:
node --version
npm --versionTip
LTS stands for "Long-Term Support." It means this version is stable, thoroughly tested, and will receive security patches for years to come. It's the version you want for any real project. The current LTS as of 2026 is Node.js v24 (codename: Krypton).
Windows gets its own version manager: fnm (Fast Node Manager). It's blazing fast, works natively in PowerShell, and is just as easy to use as NVM.
Open PowerShell and run:
winget install Schniz.fnmNote
Close and reopen PowerShell after this step so the fnm command becomes available.
fnm use --install-if-missing 24node --version
npm --versionYou should see a Node.js version starting with v24 and an npm version starting with 10.
An SSH key is like a digital passport that proves your identity to GitHub — without a password. Once it's set up, your computer and GitHub do a secret cryptographic handshake every time you push code.
You'll create two files:
| File | Description |
|---|---|
🔐 Private key (id_ed25519) |
Stays on your computer — never share this with anyone |
📢 Public key (id_ed25519.pub) |
Safe to share — you'll give this to GitHub |
In your terminal, run the following (replace the email with your GitHub email):
ssh-keygen -t ed25519 -C "your@github.email"The tool will ask you a few questions:
- Where to save the key → Press
Enterto use the default location (~/.ssh/id_ed25519) - Passphrase → Press
Enterto skip, or type a password for extra security - Confirm passphrase → Press
Enteragain (or retype your password)
Tip
ed25519 is the type of encryption algorithm. It's the modern, secure standard recommended by GitHub for new SSH keys.
Now view your public key so you can copy it:
cat ~/.ssh/id_ed25519.pubYou'll see a long string of characters that starts with ssh-ed25519. Select the entire output and copy it — you'll paste it into GitHub in the next step.
-
Go to github.com/settings/keys
-
Click the "New SSH key" button:
-
Fill in the form:
- Title — Give it a name you'll recognize (e.g.,
My Laptop,Work MacBook) - Key type — Leave it as Authentication Key
- Key — Paste the public key you copied in the previous step
- Title — Give it a name you'll recognize (e.g.,
-
Click "Add SSH key":
Run this in your terminal to confirm the key is working:
ssh -T git@github.comNote
The very first time you connect, your terminal will display a message asking if you trust GitHub's server fingerprint. Type yes and press Enter.
If everything is set up correctly, you'll see:
Hi <your-username>! You've successfully authenticated, but GitHub does not provide shell access.
That message means it worked — congratulations!
You now have a fully configured, professional-grade development environment. Here's a summary of everything you accomplished:
| ✅ | Milestone |
|---|---|
| 🐙 | Installed Git for version control |
| ⚙️ | Configured your Git identity (name, email, default branch) |
| 🟢 | Installed Node.js for running JavaScript |
| 🔑 | Generated a secure SSH key |
| 🐱 | Connected your computer to GitHub |
Try your very first Git workflow:
- Create a repository on GitHub
- Clone it to your computer:
git clone git@github.com:your-username/your-repo-name.git
- Create or edit a file, then save your changes
- Stage and commit your changes:
git add . git commit -m "My first commit"
- Push to GitHub:
git push
Tip
If your first push asks you to set an upstream branch, run: git push -u origin main

