672 words
3 minutes

Your First Git Commit - A Beginner-Friendly Guide to Version Control

Visual DX: 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:

Terminal window
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?

Terminal window
winget install --id Git.Git

(Works on Windows 10 1809+ and Windows 11.)

On Linux#

For Debian/Ubuntu:

Terminal window
sudo apt-get install git

For Fedora:

Terminal window
sudo dnf install git

For Arch-based systems:

Terminal window
sudo pacman -S git

Check the Installation#

Make sure Git is installed with:

Terminal window
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.

Terminal window
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):

Terminal window
git config --global init.defaultBranch main

Optional: avoid using Vim by default (it can be confusing for beginners). Use something simpler like nano:

Terminal window
git config --global core.editor "nano"

Prefer VS Code? Use:

Terminal window
git config --global core.editor "code --wait"

Creating Your First Repository#

Create a new folder for your project and initialize Git inside it:

Terminal window
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:

Terminal window
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:

Terminal window
git status

It will show the new file but mark it as untracked.

Tell Git to track it:

Terminal window
git add README.md

Now make your first commit:

Terminal window
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:

Terminal window
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:

Terminal window
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:

Terminal window
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:

You can always switch to the terminal when you feel ready.


Quick Cheat Sheet#

CommandDescription
git initCreates a Git repo
git statusShows changes and file states
git addStages files for commit
git commit -m ""Saves a snapshot with a message
git configSets 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

Your First Git Commit - A Beginner-Friendly Guide to Version Control
https://devops.pink/first-git-commit-a-beginner-friendly-guide-to-version-control/
Architect
Tatiana Mikhaleva
Issued
2025-05-12
Protocol
CC BY-NC-SA 4.0