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

推荐订阅源

Jina AI
Jina AI
NISL@THU
NISL@THU
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
SecWiki News
SecWiki News
Microsoft Azure Blog
Microsoft Azure Blog
J
Java Code Geeks
B
Blog RSS Feed
Blog — PlanetScale
Blog — PlanetScale
Schneier on Security
Schneier on Security
V
Vulnerabilities – Threatpost
C
CXSECURITY Database RSS Feed - CXSecurity.com
V
Visual Studio Blog
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
T
True Tiger Recordings
F
Full Disclosure
Martin Fowler
Martin Fowler
D
Docker
Stack Overflow Blog
Stack Overflow Blog
Security Latest
Security Latest
A
About on SuperTechFans
雷峰网
雷峰网
Know Your Adversary
Know Your Adversary
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Hacker News: Ask HN
Hacker News: Ask HN
B
Blog
V
V2EX - 技术
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News
S
Security Archives - TechRepublic
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
Malwarebytes
Malwarebytes
C
Check Point Blog
美团技术团队
P
Privacy International News Feed
Recorded Future
Recorded Future
博客园 - 司徒正美
T
The Blog of Author Tim Ferriss
L
LangChain Blog
Project Zero
Project Zero
P
Proofpoint News Feed
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
Scott Helme
Scott Helme
C
CERT Recently Published Vulnerability Notes
云风的 BLOG
云风的 BLOG
T
ThreatConnect
F
Fox-IT International blog

DEV Community

I Thought Coding Was The Job Beginning to market Why Your Treasure Hunt Engine Kept Crashing at 1.2M Concurrent Connections Introducing Batch Processing for ZeroGPU Kiln Crisis Management: Controlling Irregular Raw Meal in CCR Using Python The Grilling Optimizing a High-Throughput Browser-Based Box Shadow Generator: Debounced State Updates and Chunked File Readers I Was Spending $3,200/Month on GPT. Then I Tried Chinese Models. Why You Must Stop Pasting Production Payloads into Web Decoders: Building a Secure Base64 Decode Strategy Message Brokers Comparison 2026 — Kafka, RabbitMQ, NATS & Redis Streams: Which One Should You Choose? I tried every popular library for programmatic PDF form filling. None of them survived production The const enum that took down our payments Architecture of Chaos Part 3 — Event Sourcing Saved Our Audit Trail, Then a Fiber Cable Broke Stop Paying Per Cert. It's Crazy. Building Embeddable Browser Games for Website Engagement Build a Privacy-First Tampermonkey Script for Long ChatGPT Conversations XSS Attacks Are Everywhere: Reflected, Stored, DOM-Based — How to Actually Fix Them (2026) Stop letting LLMs hallucinate dates — a tool for AI agents The Platform Team Became a Finance Team /align v0.8 — personal evals for Claude Code, maintained by an LLM agent Copilot helped me deploy my passion project to the App Store Software Engineering: The Art of Thinking Out Loud (with AI) Leaked Kubernetes Secrets: Impact Assessment and Mitigation Strategies First 90 days as a junior engineer on an AI-heavy team: what to learn first Something Honest About Being a Developer on This Kind of Team JSON Schema Validator Advanced Techniques for Power Users I Built Hermes Immune System — A Safety Lab for AI Agents Google I/O 2026: MCP Is Now Infrastructure (Spark, Managed Agents, WebMCP & More) Probabilistic Graph Neural Inference for deep-sea exploration habitat design for extreme data sparsity scenarios QuantConnect Review: Running 2,400 Backtests Without Installing a Single Python Library The Complete Guide to Video APIs in 2026 (And Why Your Choice of Tool Actually Matters) Alpha Vantage vs Yahoo Finance API: Free Market Data for Side Projects — An Honest Comparison Day 20 of 60: I Built a Production-Grade Authentication System with JWT Tokens and API Key Managemen Nobody on the internet knows if you are a human The fastest way to optimize images for your web projects (Zero Server Roundtrips) We Got Burned by Veltrix Configuration Layer and Lived to Tell the Story Why Block Handed Goose to the Linux Foundation: Agentic AI Goes Open The Delve Scandal Proved SOC 2 Is Broken — Here's What Micro-SaaS Founders Should Do Instead OpenTelemetry: The Foundation of Modern Cloud-Native Observability — Traces, Metrics, Logs, and the Future of Observability Arc Browser Review: 18 Months With a Browser That Thinks Differently [Boost] Docker healthchecks: what they actually measure and what you shouldn't promise Docker healthchecks: qué miden de verdad y qué no deberías prometer I Built an AI That Roasts Cold Emails — Here's What 18,000 Drafts Taught Me Are You My Parent?: Scaffolding in the architecture necessary for keyboard handling between components. The AI Labs Found Product-Market Fit in April How I Stopped Fighting AI Context: JetBrains AI vs. Copilot in Rider I Accidentally force-pushed to main at 11 PM — So I Built an Interactive Git Undo Tool Perplexity Spaces vs You.com vs Phind: which AI search fits your dev research workflow I'm 14, can't code, and built a cognitive state app in one day — here's what happened Three Cloudflare Patterns Earned the Hard Way Aider Review: The Open-Source AI Pair Programmer That Works With Any LLM How to Measure and Improve Core Web Vitals in Under 30 Minutes Standardizing Feature Flags Is Easy to Agree On. Migrating Safely Is the Hard Part. What if UI tests validated user experience instead of selectors? Why I Stopped Believing 'Best Practices' and Started Trusting 'Works For Us' PrestaShop Doctrine: Automatically Manage the DB Prefix PrestaShop Enterprise vs Shopify Plus A .NET Dinosaur in Web3 — Day 15: DAO Voting Halyra IDE Wearable App Development Cost: How to Build a Quality MVP Without Overspending New in Vue - May 2026 427 Remote Companies Using TypeScript in 2026 MCP CI gates need receipts: tools/list is not enough 📖 DICTIONARIES IN PYTHON: THE SMART DATA VAULT I Generated a Tableau Dashboard Using Gemma 4 — Locally, No API Key, No Cloud The Hidden Way Electronics Can Start a Fire — Even Without an Open Flame I Built a Beginner-Friendly NGINX Automation CLI for Linux Servers Vibe Thinking - The PM Who Writes Requirements That an AI Can Actually Use A Refreshing Perspective on AI and Truth Kubelet Metrics: How cAdvisor and CRI Collect Kubernetes Stats How to Optimize MongoDB on Bare Metal Servers: SRE Playbook Why I Built Bamise Instead of Using Laravel How to Build a Clean Academic Dataset Without Losing Your Mind (or Your Weekend) Kubernetes Is Eating Your Budget: How to Fix EKS Over-Provisioning What Awnings Taught Me About Developer Experience Tree Traversal: Why the Order You Pick Is a Data Flow Decision I built my own forum using PHP- it came out great Optimizing Chunking and Data Extraction for Zero-Hallucination RAG Controlling Blender with AI — Building an MCP Server for 3D Creation 5 Smart Contract Vulnerabilities Every Developer Should Know in 2026 Cursor users who write failing tests before prompting the AI complete features in 37% fewer iterations than those who pr When AI Becomes a Danger: 370,000 Grok Conversations Exposed I Refactored 100 Functions With Claude. CI Was Green. Production Got Slower in 7 Spots. I read my own commits like a stranger Child Safety vs. Data Center Dollars The Reason Your AI Chatbot Feels Fast Has Nothing to Do With a Better Model Beyond Vibe-Coding What I learned testing AI translation tools in 2026 (DeepL is still good, but LLMs caught up) AWS ECS Fargate Cost Allocation: Why Your Per-Cluster Spend Shows as One Line How to Surface License Violations in GitHub Advanced Security with feluda We Deleted 10 Real Users with a Test-Cleanup Script — RCA The Decision Subtraction Framework: How to Evaluate Any AI Tool How I Access My Home PC From Anywhere Without Spending a Penny # agents.md: Teaching AI Agents How to Scrape (The Future of Web Automation) KAI vs Global vs Tojiro vs Miyabi: How to Actually Tell Japanese Knife Brands Apart Why We Accidentally Blocked Our Users: A Deep Dive into Idempotency in Distributed Systems I Connected Hermes Agent to a Live MCP Server with 59 Tools and Here's What It Actually Built Our first app is finally live on the Play Store after 4 months of hard work 🚀 I Built UUIDs That Look Random But Sort Like Timestamps (50% Smaller Indexes!)
Your Git Tree Looks Like a Crime Scene: How to Write Commits That Don’t Suck
Dometrain · 2026-05-28 · via DEV Community

It’s Friday at 4:45 PM. You’re packing your bag, thinking about the weekend, when the team lead drops a message in Slack: “The production billing engine is throwing random database exceptions. Something broke in the last deploy. We need to find out what changed.”

You jump onto GitHub, open the main branch, and look at the commit history from the last 24 hours to find the culprit. This is what you see:

  • wip
  • fixed bug
  • hope this works
  • typo
  • clean up code
  • actually fixing it now
  • fuck regex

You look at the diffs. The commit labeled clean up code contains 14 changed files, two database migrations, and a completely rewritten authentication handler. The commit labeled typo actually changed a critical calculation in the payment pipeline.

You can't trace anything. You can't safely revert a single commit because they are all massive, tangled balls of unrelated changes wrapped in useless labels. You’re stuck doing a manual line-by-line code review of 400 changes while the system bleeds cash.

If this is what your Git history looks like, you aren't just writing messy commits. You are actively torturing your teammates, your future self, and your incident response team. It’s time to talk about Git hygiene.

1. Git is a Chronicle, Not a "Save Game" Button

The root cause of a garbage Git tree is a fundamental misunderstanding of what Git is for.

Many developers treat Git like the quick-save button in a video game. They write three lines of code, smash git commit -am "wip", and repeat this every ten minutes just in case their laptop explodes.

Let's clarify something: Your local branch belongs to you. The shared history belongs to the team.

It is completely fine to commit absolute garbage locally while you are figuring out a problem. Knock yourself out. But the moment you open a Pull Request to merge that code into a shared branch (main, dev, etc.), you have a responsibility to clean your room. The history should read like an organized, step-by-step story of how a feature was built—not a real-time stream of consciousness from a confused developer.

2. The Anatomy of a Commit That Doesn't Suck

A good commit message is a form of asynchronous communication. It exists to answer two questions for the person reading it three years from now: What changed? and Why did it change?

To do this effectively, the industry has a widely accepted standard called the 50/72 Rule. It’s incredibly simple, yet almost nobody follows it by default.

Plaintext
Summarize the change in 50 characters or less (Imperative mood)

More detailed explanatory text, if necessary. Wrap it to about 72 
characters. Focus on WHY the change was made, not just WHAT changed. 
Reference any relevant issue or ticket numbers at the bottom.

Fixes #402

Enter fullscreen mode Exit fullscreen mode

The Rules of the Subject Line:

  • Use the Imperative Mood: Write your commit subject as if you are giving a command to the codebase. Use Add checkout endpoint, not Added checkout endpoint or Adding checkout endpoint.

  • Pro-Tip: A good trick to check this is to complete the sentence: "If applied, this commit will... [Your Subject Line]." If it makes grammatical sense, you’re doing it right.

  • Capitalise the first letter.

  • Do not end the subject line with a period. It’s a title, not a sentence.

  • Keep it short: Under 50 characters ensures it doesn't get truncated in GitHub or terminal logs.

The Rules of the Body:

The code tells you how something was done. The commit body should tell you why. If you had to implement a weird workaround because a third-party API has a known bug, put it in the commit body. The person debugging this code in 2029 needs to know you didn't just write that ugly code because you were lazy, you wrote it because you were constrained.

3. Your Secret Weapon: Interactive Rebasing

"But I like making tiny, messy commits while I work! It helps me track my thoughts!" Great. Keep doing that. But before you hit that "Create Pull Request" button, you need to run an Interactive Rebase to squash your messy drafts into a clean production history.

Let's say you're on a feature branch and you've made 5 messy commits. Run this in your terminal:

Bash
git rebase -i HEAD~5

Enter fullscreen mode Exit fullscreen mode

This opens a text menu in your editor that looks something like this:

Plaintext
pick a1b2c3d Add initial checkout logic
pick e4f5g6h wip
pick i7j8k9l typo fix
pick m0n1o2p refactor billing service
pick q3r4s5t hope this works

Enter fullscreen mode Exit fullscreen mode

This menu allows you to rewrite history before anyone else sees it. You can change pick to commands like squash (to blend a commit into the one above it) or reword (to fix a bad message).

If you update the menu to look like this:

Plaintext
pick a1b2c3d Add initial checkout logic
squash e4f5g6h wip
squash i7j8k9l typo fix
pick m0n1o2p Refactor billing service parameters
squash q3r4s5t hope this works

Enter fullscreen mode Exit fullscreen mode

When you save and close, Git will magically compress those 5 messy, chaotic commits into 2 clean, logical steps. Your wip and typo fix commits disappear from history, absorbed into the main feature logic where they belong. Your Git tree goes from looking like a crime scene to a masterclass in professional software delivery.

4. Git is a Forensic Tool, Use It Like One

When you maintain high Git hygiene, the tool starts working for you. You gain access to advanced forensic commands that make debugging complex system bugs incredibly fast.

git log --oneline

Instead of scrolling through pages of text, you get a clean, high-level map of the system's evolution. If your messages are disciplined, you can spot anomalous changes in seconds.

git blame

When you find a broken line of code, git blame tells you the exact commit that introduced it. If that commit message says Fix database deadlock under high load (#204), you instantly have the context, the pull request, and the original business requirements behind that line of code. If it says wip, you have nothing.

git bisect

This is the holy grail of debugging. If you know the app worked perfectly on Monday, but it's broken today, and there are 200 commits in between, you don't have to manually check them all. git bisect uses a binary search algorithm to find the exact commit that broke the app. It checks a commit in the middle, asks you if the code is good or bad, and narrows down the search. If your commits are small and atomic, git bisect will point to a single 10-line change, and your bug is found in minutes.

5. Moving Past the Coder Mindset

It’s easy to look at things like commit formatting, interactive rebasing, and branching hygiene as "extra work." Juniors often complain that it slows them down.

But true seniority isn't about how fast you can type code into a file. It’s about how easily that code can be maintained, debugged, and understood by a team over a multi-year lifecycle. A developer who leaves a trail of unreadable commits behind them is creating a tax that the rest of the team has to pay every time there is a production incident.

Excellent development hygiene is a habit that has to be learned intentionally. Most bootcamps and standard video platforms will teach you how to run git commit -m "first commit", but they completely ignore the operational realities of working on production codebases at scale.

This is where real-world, no-nonsense engineering training makes a difference. At Dometrain, our courses focus heavily on the practices that define the top 1% of engineers. We don't just show you how to write modern C# syntax; we focus on the everyday developer habits—from clean testing to robust architectural patterns—that help you step off the mid-level plateau and confidently own a production ecosystem.

The Git Hygiene Checklist

Before you push your next branch to the remote repository, spend two minutes running through this checklist:

  1. Run git log locally: Look at your branch history. Does it look like a cohesive story or a messy scratchpad?

  2. Interactive Rebase: If you see wip, typo, or duplicate commits, run git rebase -i and squash them down.

  3. Check your subject lines: Are they under 50 characters? Do they start with a capital letter? Are they written in the imperative mood (Add, Fix, Remove)?

Isolate your changes: Ensure a single commit does one thing. Don't mix formatting changes, feature development, and dependency updates into a single giant commit.

Your Git tree is a direct reflection of your engineering discipline. Stop treating it like an automated backup tool, clean up your history, and start writing commits that make your teammates want to buy you a coffee instead of tracking you down after a failed deployment.