惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Schneier on Security
Recent Announcements
Recent Announcements
C
Check Point Blog
Stack Overflow Blog
Stack Overflow Blog
Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
爱范儿
爱范儿
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
L
LangChain Blog
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
月光博客
月光博客
AI
AI
美团技术团队
SecWiki News
SecWiki News
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
Cybersecurity and Infrastructure Security Agency CISA
M
MIT News - Artificial intelligence
PCI Perspectives
PCI Perspectives
aimingoo的专栏
aimingoo的专栏
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Visual Studio Blog
T
The Exploit Database - CXSecurity.com
小众软件
小众软件
N
News | PayPal Newsroom
阮一峰的网络日志
阮一峰的网络日志
人人都是产品经理
人人都是产品经理
NISL@THU
NISL@THU
Hacker News: Ask HN
Hacker News: Ask HN
Security Latest
Security Latest
MongoDB | Blog
MongoDB | Blog
H
Heimdal Security Blog
Schneier on Security
Schneier on Security
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
B
Blog RSS Feed
D
Docker
Spread Privacy
Spread Privacy
Cloudbric
Cloudbric
www.infosecurity-magazine.com
www.infosecurity-magazine.com
I
Intezer
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
AWS News Blog
AWS News Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Day 4 — Git & GitHub Fundamentals
Rahul Joshi · 2026-05-15 · via DEV Community

Modern software development is impossible without version control. Whether you're building applications alone, working in a startup, contributing to open source, or managing enterprise infrastructure — Git and GitHub are at the center of everything.

From tracking code changes to handling production deployments, Git powers modern engineering workflows.

In this guide, we’ll deeply cover:

  • What Git actually is
  • How Git works internally
  • Git basics
  • Branching strategies
  • Pull Requests
  • Merge conflicts
  • Git workflows
  • Essential Git commands
  • Best practices used by professional teams

🔗 Resources


🌍 What is Git?

Git is a distributed version control system (DVCS) created by Linus Torvalds in 2005.

Git helps developers:

  • Track changes in code
  • Collaborate safely
  • Maintain project history
  • Revert mistakes
  • Manage releases
  • Work on multiple features simultaneously

🧠 Why Git Was Created

Before Git, developers mainly used centralized systems like:

  • SVN
  • CVS

These systems had problems:

  • Slow performance
  • Central server dependency
  • Difficult branching
  • Risk of losing history

Git solved these issues by making every developer’s machine a complete copy of the repository.

That means:

  • Faster operations
  • Offline work
  • Safer collaboration
  • Better branching support

🔥 What Makes Git Powerful?

Feature Why It Matters
Distributed architecture Every developer has full repository history
Fast branching Lightweight feature development
Snapshots Tracks repository states efficiently
Data integrity Uses SHA hashing
Collaboration Multiple developers work safely

🌐 What is GitHub?

GitHub is a cloud-based platform that hosts Git repositories.

GitHub adds:

  • Remote repository hosting
  • Collaboration tools
  • Pull Requests
  • CI/CD integration
  • Code review systems
  • Security scanning
  • Issue tracking
  • Open-source collaboration

Think of it like this:

Tool Purpose
Git Version control engine
GitHub Collaboration platform

⚙️ Understanding How Git Works Internally

Many beginners struggle here, but once you understand Git’s internal workflow, everything becomes easier.

Git has three main areas:


1️⃣ Working Directory

This is your actual project folder.

Example:

app.js
package.json
README.md

Enter fullscreen mode Exit fullscreen mode

You edit files here.


2️⃣ Staging Area (Index)

This is Git’s preparation area.

You choose which changes should go into the next commit.

Example:

git add app.js

Enter fullscreen mode Exit fullscreen mode

Now app.js is staged.


3️⃣ Repository (.git)

This stores:

  • Commit history
  • Branches
  • Metadata
  • References

This is Git’s database.


📦 Git Repository Structure

When you initialize Git:

git init

Enter fullscreen mode Exit fullscreen mode

Git creates:

.git/

Enter fullscreen mode Exit fullscreen mode

Inside .git:

  • Objects
  • References
  • Commit history
  • Configuration
  • Branch metadata

⚠️ Never manually modify .git.


🚀 Git Basics

📁 Initializing a Repository

git init

Enter fullscreen mode Exit fullscreen mode

This turns your project into a Git repository.


📥 Cloning a Repository

git clone https://github.com/user/project.git

Enter fullscreen mode Exit fullscreen mode

This downloads:

  • Files
  • Commit history
  • Branches
  • Remote configuration

📊 Checking Repository Status

git status

Enter fullscreen mode Exit fullscreen mode

Shows:

  • Modified files
  • Staged changes
  • Untracked files

This command becomes your best friend.


➕ Staging Changes

Stage everything:

git add .

Enter fullscreen mode Exit fullscreen mode

Stage a single file:

git add server.js

Enter fullscreen mode Exit fullscreen mode


💾 Creating Commits

git commit -m "Added authentication middleware"

Enter fullscreen mode Exit fullscreen mode

A commit is:

  • A snapshot
  • A checkpoint
  • A historical record

🧾 Good Commit Messages

❌ Bad:

git commit -m "fix"

Enter fullscreen mode Exit fullscreen mode

✅ Good:

git commit -m "Fixed JWT token expiration handling"

Enter fullscreen mode Exit fullscreen mode

Professional teams use:

  • Clear descriptions
  • Small commits
  • Atomic changes

🌿 Understanding Branches

Branches are one of Git’s biggest strengths.

A branch is simply a movable pointer to commits.


🏗️ Why Branches Matter

Without branches:

  • Everyone edits the same code
  • Features collide
  • Production becomes unstable

Branches solve this.


🔹 Creating Branches

git branch feature-login

Enter fullscreen mode Exit fullscreen mode

Switch to branch:

git checkout feature-login

Enter fullscreen mode Exit fullscreen mode

Modern shortcut:

git checkout -b feature-login

Enter fullscreen mode Exit fullscreen mode


🔍 Viewing Branches

git branch

Enter fullscreen mode Exit fullscreen mode

Current branch shows:

* main

Enter fullscreen mode Exit fullscreen mode


🔀 Merging Branches

Merge feature into main:

git checkout main
git merge feature-login

Enter fullscreen mode Exit fullscreen mode

Git combines histories.


⚠️ Merge Conflicts

Conflicts happen when:

  • Two developers edit the same lines
  • Git cannot automatically decide

Example conflict:

<<<<<<< HEAD
console.log("Old Code");
=======
console.log("New Code");
>>>>>>> feature-login

Enter fullscreen mode Exit fullscreen mode

You must manually resolve it.


🌳 Branching Strategies

1️⃣ Feature Branch Workflow

Each feature gets a separate branch.

Example:

feature-payment
feature-auth
feature-dashboard

Enter fullscreen mode Exit fullscreen mode

Flow

  1. Create branch
  2. Develop feature
  3. Open Pull Request
  4. Review
  5. Merge

Advantages

  • Cleaner history
  • Safer development
  • Easy rollback

Most startups use this.


2️⃣ Git Flow

One of the most famous workflows.

Popularized by Vincent Driessen.


Git Flow Branches

Git Flow

Branch Purpose
main Production-ready
develop Integration branch
feature/* New features
release/* Release preparation
hotfix/* Emergency fixes

Git Flow Lifecycle

🔹 Feature Development

git checkout develop
git checkout -b feature-auth

Enter fullscreen mode Exit fullscreen mode


🔹 Release Creation

git checkout -b release-v1.0

Enter fullscreen mode Exit fullscreen mode


🔹 Hotfix Production Bugs

git checkout main
git checkout -b hotfix-login

Enter fullscreen mode Exit fullscreen mode


✅ Advantages

  • Organized releases
  • Stable production
  • Enterprise friendly

❌ Disadvantages

  • Complex workflow
  • Too many branches
  • Slower deployments

3️⃣ Trunk-Based Development

Used heavily in:

  • DevOps teams
  • CI/CD environments
  • Cloud-native engineering

Core idea:

  • Small commits
  • Frequent merges
  • Short-lived branches

Main branch = trunk.


✅ Benefits

  • Faster deployments
  • Smaller conflicts
  • Continuous integration friendly

Popular in:

  • Google
  • Netflix
  • Meta

🔄 Pull Requests (PRs)

A Pull Request is a proposal to merge code changes.

PRs are central to modern collaboration.


🧩 Pull Request Lifecycle

Step 1 — Create Branch

git checkout -b feature-auth

Enter fullscreen mode Exit fullscreen mode


Step 2 — Push Branch

git push origin feature-auth

Enter fullscreen mode Exit fullscreen mode


Step 3 — Open PR on GitHub

GitHub compares:

  • Source branch
  • Target branch

Step 4 — Code Review

Teams review:

  • Logic
  • Security
  • Readability
  • Performance

Step 5 — CI/CD Runs

Automated checks:

  • Tests
  • Linting
  • Security scans

Step 6 — Merge PR

Once approved:

  • Squash merge
  • Rebase merge
  • Standard merge

🔐 Why Pull Requests Matter

PRs improve:

  • Code quality
  • Security
  • Team collaboration
  • Knowledge sharing

They act like a checkpoint before production.


🧠 Types of Git Merges

🔹 Fast Forward Merge

Simple linear merge.

Occurs when no divergence exists.


🔹 Three-Way Merge

Git creates a merge commit.

Most common in teams.


🔹 Squash Merge

Combines all commits into one.

Creates cleaner history.


🔹 Rebase

Moves commits on top of the latest branch.

Example:

git rebase main

Enter fullscreen mode Exit fullscreen mode

Benefits

  • Linear history
  • Cleaner logs

Risk

  • Can rewrite history

⚙️ Common Git Workflows

1️⃣ Centralized Workflow

Everyone pushes to the same branch.

Simple but risky.

Best for:

  • Small teams
  • Learning

2️⃣ Feature Branch Workflow

Separate branches for features.

Most commonly used workflow today.


3️⃣ Forking Workflow

Mostly used in open source.

Flow

  1. Fork repository
  2. Clone fork
  3. Create branch
  4. Push changes
  5. Open PR to original repo

Used heavily on GitHub.


🚨 Common Git Problems

❌ Detached HEAD State

Occurs when checking out commits directly.

Example:

git checkout 93f4c2

Enter fullscreen mode Exit fullscreen mode

You are no longer on a branch.


❌ Force Push Problems

git push --force

Enter fullscreen mode Exit fullscreen mode

Dangerous because:

  • Rewrites history
  • Can delete teammates’ work

Use carefully.


❌ Huge Commits

Huge commits are bad because:

  • Hard to review
  • Hard to debug
  • Hard to revert

🧹 Git Best Practices

✅ Commit Frequently

Small commits = easier debugging.


✅ Use Meaningful Branch Names

✅ Good:

feature-payment-api
bugfix-auth-timeout

Enter fullscreen mode Exit fullscreen mode

❌ Bad:

test123
newbranch

Enter fullscreen mode Exit fullscreen mode


✅ Protect Main Branch

Never directly push production-breaking code.


✅ Pull Before Push

git pull origin main

Enter fullscreen mode Exit fullscreen mode

Avoids conflicts.


✅ Use .gitignore

Prevent sensitive or unnecessary files.

Example:

node_modules/
.env
dist/
coverage/

Enter fullscreen mode Exit fullscreen mode


🔐 Git in DevOps & CI/CD

Git is deeply integrated into:

  • CI/CD pipelines
  • Infrastructure as Code
  • Kubernetes deployments
  • DevSecOps automation

Modern pipelines trigger automatically when:

  • Code is pushed
  • PRs are merged
  • Releases are tagged

Popular integrations:

  • GitHub Actions
  • GitLab CI/CD
  • Jenkins
  • CircleCI

🚀 Final Thoughts

Git is more than just commands.

It’s a system that enables:

  • Safe collaboration
  • Scalable development
  • Reliable deployments
  • Modern DevOps practices

Once you truly understand:

  • Branching
  • Commits
  • PRs
  • Workflows
  • Collaboration strategies

…you stop being just a coder and start working like a professional software engineer.

The best way to master Git is:

  • Use it daily
  • Break things
  • Resolve conflicts
  • Work on real projects

Because every professional developer spends a huge part of their career inside Git.