Git has a reputation for being scary because people encounter it during an emergency: a broken project, a cryptic error, and a coworker saying “just rebase.” It does not have to start that way. Git is simply a tool that takes snapshots of your files so you can experiment without losing your work.
This beginner guide explains Git in everyday language—no jargon pileup—so you can use it for code, notes, or config files on Windows, Linux, or macOS.
What Git Is (and Is Not)
Git is a version control system. It records versions of a folder (a repository) over time. It is not GitHub, though GitHub and similar sites host Git repositories online. You can use Git completely offline on a laptop.
- Repository – a project folder tracked by Git
- Commit – a snapshot with a message
- Branch – a movable line of snapshots for experiments
1. Install Git and Set Your Name
Install Git from the official site or your package manager. Then tell Git who you are (this labels your snapshots):
git config --global user.name "Your Name"
git config --global user.email "you@example.com"Use an email you are comfortable associating with projects. On Windows, Git Bash or PowerShell both work.
2. Start a Repository in a Real Folder
Navigate to a project folder and run:
git init
git statusgit status is your map. It tells you which files are new, changed, or ready to snapshot. Create a .gitignore file early so secrets, node_modules, and build outputs are not committed.
3. The Everyday Loop: Add, Commit, Repeat
The basic workflow is deliberately small:
git add .
git commit -m "Explain why you made this change"
git statusgit add stages changes; git commit records them. Write commit messages for humans—future you included. Prefer many small commits over one gigantic mystery dump.
4. See History Without Fear
git log --oneline
git diffgit log lists snapshots; git diff shows unstaged changes. These two commands replace the old habit of copying folders named final_v2_really_final.
5. Branches for Safe Experiments
Want to try a risky redesign? Create a branch:
git branch experiment
git switch experimentDo work, commit, and switch back to your main branch when done. Merging can wait until you are comfortable; even using branches as disposable sandboxes is already a win.
6. Connect to GitHub Only When You Need Sharing or Backup
Remote hosting is optional. When you are ready, create an empty repository on a host, then follow their instructions to add a remote and push. Until then, Git still protects you locally—and you can zip a .git folder as part of backups.
Never force-push to shared main branches until you understand what you are overwriting. Beginners rarely need force operations.
Undo Tools Beginners Actually Need
Before a commit, you can unstage with git restore --staged file and discard unstaged edits with care using git restore file. After a commit that has not been shared, git commit --amend can fix a message—but do not amend commits others already pulled.
If you feel lost, run git status and read it slowly. Most panic moments are solved by noticing you are on the wrong branch or forgot to stage a file. Avoid memorizing twenty commands; master five and look up the rest.
Practice on a throwaway folder of text files for one evening. Muscle memory from a safe playground transfers cleanly to real projects the next day.
A 20-Minute Practice Project
Create a folder called git-practice, add a notes.txt file, initialize Git, and make three commits as you add sentences. Then create a branch, change the file, and switch back. Notice how the file contents change with the branch. That single exercise teaches more than a long command cheat sheet.
When you are ready for collaboration, learn git clone, git pull, and git push on a throwaway GitHub repository. Read merge conflicts slowly: Git is showing two versions of the same region and asking you to keep the right lines. It is not angry—it is incomplete on purpose.
Once the basics feel boring, learn how to write a useful README.md and keep commits focused on one idea. Those soft skills matter more in teams than clever one-liners. Git is a communication tool disguised as software.
Putting It Together
Learn Git as a daily camera for your projects: status, add, commit, log, diff, and gentle branching. Ignore advanced commands until a real need appears.
If you pair this habit with a markdown notes vault or a homelab compose folder, you will accidentally build professional discipline—one clear snapshot at a time.
