Workflow & Tools
Git & GitHub Basics
How I keep my changes under control with Git.
I used to manage my projects completely without Git. Every experiment was a risk: one wrong click, one bold code change – and often the entire project ended up in chaos. Real teamwork was barely possible without destroying each other's code.
When I first heard about Git, it completely changed my view of software development. Suddenly, blind experimentation turned into a clear, controlled structure. Today, Git is my safety net that allows me to go boldly in new directions without fear.
1. Identity & Setup
The first thing I do on every new machine. Git needs to know who you are so your "green squares" on GitHub are actually credited to your account.
git config --global user.name "Your Name"
git config --global user.email "your@email.com"Make sure to use exactly the email you registered with on GitHub.
2. Bringing a Project to Life
There are two ways: Either I start from scratch (init) or I copy a project that already exists on GitHub (clone).
Initialize New
# In your project folder
git initClone from GitHub
# Load project from GitHub
git clone https://github.com/user/project.git3. Staying on Top of Things
Git is like a review partner for me. Before I save anything, I ask Git: "What's the current status?". I type this command almost compulsively every few minutes – it gives me the security of knowing exactly which files I've touched.
The git status is your best friend. It shows you exactly which files Git 'sees' and what happens next.
4. The Heartbeat: Saving Changes
A commit is not simple saving (like CTRL+S) to me. It's a conscious decision: "This state is good, I want to keep it." I always try to bundle small, logical packages instead of committing one huge mess at once.
# 1. Add changes to the queue (Staging Area)
git add .
# 2. Create a snapshot with a clear message
git commit -m "feat: add hero section typography"
# Pro tip: Add and commit changed files directly (in one step)
git commit -am "fix: button alignment on mobile"Avoid meaningless messages like 'fix stuff' or 'update'. Write briefly what happened. Your 'future self' will thank you.
I prefer 10 small, clear steps over one huge chunk. Small commits make emergency rollbacks much more precise.
Interactive Git Lifecycle
Commit History (Your Snapshots)
5. Synchronization: Up to GitHub
So your code doesn't just live on your hard drive, we mirror it to the cloud. This is the moment your local project becomes a real backup.
Local PC
GitHub Cloud
# 1. Upload your local snapshots to GitHub
git push origin main
# 2. Download the latest version from GitHub
git pull origin main
# Bonus: If you need to reconnect a repo
git remote add origin https://github.com/user/project.gitRemember: git push uploads, git pull downloads changes.
6. Hygiene: What Git Should Ignore
Not everything belongs in your time machine. We keep huge libraries – or more importantly – secret keys out. Once uploaded to GitHub, passwords are public. After my first mistake, the .gitignore is my most important file.
# 1. Ignore large dependencies
node_modules/
# 2. Ignore build folders
dist/
.angular/
# 3. Secret credentials (IMPORTANT!)
.env
auth.json
# 4. System files
.DS_StoreNEVER put .env files with passwords in Git. Instead, use a .env.example as a template for others.