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 gitNOTEHomebrew 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 gitFor Fedora:
sudo dnf install gitFor Arch-based systems:
sudo pacman -S gitCheck the Installation
Make sure Git is installed with:
git --versionIf 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"Set main as the default branch name (instead of the older master):
git config --global init.defaultBranch mainOptional: 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-repogit initYou 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.mdNOTEFile 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 statusIt will show the new file but mark it as untracked.
Tell Git to track it:
git add README.mdNow 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/" > .gitignoreWant 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 trueThis 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 statusgit config --global alias.co checkoutgit config --global alias.br branchNow 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.
VERDICT & AESTHETICS
- Visual Doctrine: Traditional DevRel creates noise. I engineer clarity, proving that deep infrastructure and an unapologetically pink aesthetic belong in the same boardroom. Deploy like a queen. Study the architecture on YouTube.
- The Syndicate: Stop fighting your deployments alone. Gain access to zero-friction protocols, enterprise subsidies, and the DevOps Army. Enter the Discord Ecosystem.
Tatiana Mikhaleva
Principal Developer Advocate · Docker Captain · IBM Champion · AWS Community Builder