Your First Git Commit – A Beginner-Friendly Guide to Version Control
Hey, tech queens! 👩💻✨
If you’ve ever seen the word Git and thought:
“Okay, this sounds important… but also kind of intimidating?”
You’re not alone. But here’s the good news: Git isn’t scary — it’s an essential tool that’ll make your coding life much easier. Let’s walk through your first Git setup and commit, step by step — no jargon, no stress.
What Is Git, Really?
Think of your code like a project notebook. You want to:
- save versions as you go,
- undo mistakes,
- and maybe work on it with other people — without chaos.
Git is the version control system that makes all of that possible.
It helps you:
- snapshot your work at any time,
- roll back if something breaks,
- and collaborate smoothly with others.
Installing Git (No Stress, Just Steps)
On macOS
Open Terminal and run:
brew install git
Note: Homebrew must be installed beforehand.
If your Mac prompts you to install Xcode Command Line Tools, accept it — that’s normal.
On Windows
Simplest method: download Git from git-scm.com. It includes Git Bash, which gives you a helpful command-line interface.
Prefer using the terminal?
winget install --id Git.Git
(Works on Windows 10 1809+ and Windows 11.)
On Linux
For Debian/Ubuntu:
sudo apt-get install git
For Fedora:
sudo dnf install git
For Arch-based systems:
sudo pacman -S git
Check the Installation
Make sure Git is installed with:
git --version
If you see a version number, you’re all set.
Configure Git (Just Once)
Git tags your work with your name and email so you can track who made which changes — even if it’s just you.
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Set main
as the default branch name (instead of the older master
):
git config --global init.defaultBranch main
Optional: avoid using Vim by default (it can be confusing for beginners). Use something simpler like nano
:
git config --global core.editor "nano"
Prefer VS Code? Use:
git config --global core.editor "code --wait"
Creating Your First Repository
Create a new folder for your project and initialize Git inside it:
mkdir my-first-repo && cd my-first-repo
git init
You now have a Git repository — a versioned folder ready to track changes.
Add a File and Make Your First Commit
Let’s create a basic file:
echo "Hello, Git!" > README.md
Note: File names like README.md and readme.md are treated the same on macOS and Windows, but they’re different on Linux — case matters.
Check Git’s status:
git status
It will show the new file but mark it as untracked.
Tell Git to track it:
git add README.md
Now make your first commit:
git commit -m "Add README"
Done — your first snapshot is saved in Git history!
Bonus: Use .gitignore
to Keep Things Clean
You might have folders or files you don’t want to track — like node_modules
, log files, or build output.
Create a .gitignore
file:
echo "node_modules/" > .gitignore
Want help generating one for your tech stack? Check out gitignore.io.
Optional (But Handy) – Windows Line Ending Fix
If you’re on Windows and see warnings like “LF will be replaced by CRLF,” run:
git config --global core.autocrlf true
This helps avoid annoying line ending issues between systems.
Make Things Faster with Aliases
Tired of typing full commands? Set up aliases:
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.br branch
Now you can use git st
instead of git status
. Shortcuts = efficiency.
Prefer GUIs Over Command Line?
If the terminal isn’t your thing (yet), try a visual interface:
- GitHub Desktop — beginner-friendly and intuitive
- Sourcetree — more advanced but still beginner-usable
You can always switch to the terminal when you feel ready.
Quick Cheat Sheet
Command | Description |
---|---|
git init |
Creates a Git repo |
git status |
Shows changes and file states |
git add |
Stages files for commit |
git commit -m "" |
Saves a snapshot with a message |
git config |
Sets global Git settings (name, editor, etc.) |
You Did It
You installed Git, configured it, created a repo, and made your first commit.
That’s a big step in your dev journey — version control is a core skill for any developer.
Now you’ve got the tools and confidence to take control of your projects.
Tools I Personally Trust
If you want to make your digital life a little calmer — here are two tools I use every day:
🛸 Proton VPN – A trusted VPN that secures your Wi-Fi, hides your IP, and blocks trackers. Even in that no-password café Wi-Fi, you’re safe.
🔑 Proton Pass – A password manager with on-device encryption. Passwords, logins, 2FA — always with you, and only for you.
These are partner links — you won’t pay a cent more, but you’ll be supporting DevOps.Pink. Thank you — it really means a lot 💖
Refill My Coffee Supplies
💖 PayPal
🏆 Patreon
💎 GitHub
🥤 BuyMeaCoffee
🍪 Ko-fi
Follow Me
🎬 YouTube
🐦 X / Twitter
🎨 Instagram
🐘 Mastodon
🧵 Threads
🎸 Facebook
🧊 Bluesky
🎥 TikTok
💻 LinkedIn
🐈 GitHub
Is this content AI-generated?
Absolutely not! Every article is written by me, driven by a genuine passion for Docker and backed by decades of experience in IT. I do use AI tools to polish grammar and enhance clarity, but the ideas, strategies, and technical insights are entirely my own. While this might occasionally trigger AI detection tools, rest assured—the knowledge and experience behind the content are 100% real and personal.