Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Category: Git

Git

Why Git Rebase “Loses” Commits (It Doesn’t — You Did)

- 29.01.26 - ErcanOPAK comment on Why Git Rebase “Loses” Commits (It Doesn’t — You Did)

Commits aren’t deleted — they’re detached. What actually happens Rebase rewrites history Old commits lose branch references They become unreachable, not gone Recovery git reflog git checkout <lost-commit-hash> Lesson If Git feels scary, you’re missing the mental model, not commands.

Read More
Git

Undo Local Changes Safely

- 28.01.26 - ErcanOPAK comment on Undo Local Changes Safely

git restore . Why it mattersModern replacement for dangerous commands.

Read More
Git

Search History by Content

- 28.01.26 - ErcanOPAK comment on Search History by Content

git log -S “methodName” Why it mattersFind when logic changed, not just files.

Read More
Git

See Who Changed a Line and Why

- 27.01.26 - ErcanOPAK comment on See Who Changed a Line and Why

git blame file.cs Why it mattersContext beats guesswork.

Read More
Git

Fix Last Commit Without New History

- 27.01.26 - ErcanOPAK comment on Fix Last Commit Without New History

git commit –amend Why it mattersClean history, no noise.

Read More
Git

Visualize Branch History Clearly

- 26.01.26 - ErcanOPAK comment on Visualize Branch History Clearly

git log –oneline –graph –all Why it mattersInstant mental model of the repo.

Read More
Git

Stash Only What You Need

- 26.01.26 - ErcanOPAK comment on Stash Only What You Need

git stash push -m “temp” file.cs Why it mattersCleaner context switching.

Read More
Git

Speed Up Large Repos with Partial Clones

- 25.01.26 - ErcanOPAK comment on Speed Up Large Repos with Partial Clones

Huge repo? Clone only what you need. git clone –filter=blob:none <repo> Why this mattersMassive bandwidth and disk savings for CI and dev machines.

Read More
Git

The Clean Way to Undo a Pushed Commit (Without Breaking History)

- 25.01.26 - ErcanOPAK comment on The Clean Way to Undo a Pushed Commit (Without Breaking History)

Never git reset on shared branches. git revert <commit-hash> Why this mattersCreates a safe inverse commit — teammates stay happy.

Read More
Git

Why git pull Is Dangerous (And What to Use Instead)

- 24.01.26 | 24.01.26 - ErcanOPAK comment on Why git pull Is Dangerous (And What to Use Instead)

git pull = fetch + merge (implicit and risky). git fetch origin git rebase origin/main Why this mattersCleaner history, fewer merge commits, easier reviews.

Read More
Git

The One Command That Saves You From Accidental Commits

- 24.01.26 - ErcanOPAK comment on The One Command That Saves You From Accidental Commits

Ever committed secrets or junk? git reset –soft HEAD~1 What happensCommit undone, changes preserved, history clean.

Read More
Git

Git Pull Breaks Local Changes

- 23.01.26 - ErcanOPAK comment on Git Pull Breaks Local Changes

No conflicts, code wrong. Why it happensAutomerge overwrote assumptions. Why it mattersSilent regressions. Vital fix Review diffs before pull.

Read More
Git

Git History Looks Clean but Bugs Appear

- 23.01.26 - ErcanOPAK comment on Git History Looks Clean but Bugs Appear

Commits fine, logic broken. Why it happensReverts without context. Why it mattersDebugging history useless. Vital fix Prefer revert commits with explanations.

Read More
Git

Git Repos Become Heavy Over Time

- 22.01.26 - ErcanOPAK comment on Git Repos Become Heavy Over Time

Clone gets slower. Why it happensLarge files tracked forever. Why it mattersCI pipelines slow down. Smart fixUse Git LFS early.

Read More
Git

Git Merges Look Correct But Logic Breaks

- 22.01.26 - ErcanOPAK comment on Git Merges Look Correct But Logic Breaks

No conflicts, still bugs. Why it happensSemantic conflicts are invisible. Why it mattersProduction errors. Smart fixRebase for logic clarity.

Read More
Git

Git Hooks Prevent Bad Commits Early

- 21.01.26 - ErcanOPAK comment on Git Hooks Prevent Bad Commits Early

Errors reach main branch. Why it happensNo automated checks. Why it mattersBugs spread fast. Smart fixUse pre-commit hooks.

Read More
Git

Git History Becomes Hard to Read

- 21.01.26 - ErcanOPAK comment on Git History Becomes Hard to Read

Too many “fix” commits. Why it happensNo commit hygiene. Why it mattersCode reviews slow down. Smart fixSquash logically related commits.

Read More
Git

Git Conflicts Keep Reappearing

- 18.01.26 - ErcanOPAK comment on Git Conflicts Keep Reappearing

Same files, same pain. WhyLong-lived branches. TipMerge often, keep branches short.

Read More
Git

Git Rebase Feels Dangerous

- 18.01.26 - ErcanOPAK comment on Git Rebase Feels Dangerous

Fear of losing work. WhyRebase misunderstood. TipUse rebase on local branches only.

Read More
Git

Git Branches Linger Forever

- 16.01.26 - ErcanOPAK comment on Git Branches Linger Forever

Dead branches pile up. WhyNo cleanup policy. TipAutomate stale branch deletion.

Read More
Git

Git History Becomes Hard to Read

- 16.01.26 - ErcanOPAK comment on Git History Becomes Hard to Read

Commits exist, meaning lost. WhyOverloaded commit messages. TipOne intent per commit.

Read More
Git

Git Conflicts Repeat in the Same Areas

- 15.01.26 - ErcanOPAK comment on Git Conflicts Repeat in the Same Areas

Same files, same pain. WhyUnclear ownership boundaries. TipDefine ownership per directory.

Read More
Git

Git Repositories Become Hard to Clone

- 15.01.26 - ErcanOPAK comment on Git Repositories Become Hard to Clone

Clone times increase. WhyLarge binary history. TipMigrate binaries to Git LFS early.

Read More
Git

Git History Loses Meaning

- 14.01.26 - ErcanOPAK comment on Git History Loses Meaning

Commits exist, context is gone. WhyMessages describe actions, not intent. TipExplain why, not what.

Read More
Git

Git Repositories Become Fragile Over Time

- 14.01.26 - ErcanOPAK comment on Git Repositories Become Fragile Over Time

Small changes cause big conflicts. WhyNo branch discipline. TipShort-lived feature branches.

Read More
Git

Git Branches Live Too Long

- 13.01.26 - ErcanOPAK comment on Git Branches Live Too Long

Merges become painful. WhyBranches drift far from main. Tip Rebase or merge frequently.

Read More
Git

Git Repositories Become Hard to Maintain

- 13.01.26 - ErcanOPAK comment on Git Repositories Become Hard to Maintain

History exists, context is lost. WhyCommit messages lack intent. Tip Write commits explaining why, not what.

Read More
Git

Git Conflicts Repeat in the Same Files

- 12.01.26 - ErcanOPAK comment on Git Conflicts Repeat in the Same Files

Every merge hurts. WhyUnstable file ownership. Tip Define code ownership early.

Read More
Git

Git History Becomes Hard to Read

- 12.01.26 - ErcanOPAK comment on Git History Becomes Hard to Read

Commits exist, meaning is lost. WhyMixed-purpose commits. Tip One intent per commit.

Read More
Git

Git Blame Becomes Useless Over Time

- 11.01.26 - ErcanOPAK comment on Git Blame Becomes Useless Over Time

Everyone touched everything. WhyFormatting commits pollute history. Fix Separate formatting-only commits.

Read More
Page 3 of 4
« Previous 1 2 3 4 Next »

Posts pagination

« Previous 1 2 3 4 Next »
April 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Mar    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (950)
  • How to add default value for Entity Framework migrations for DateTime and Bool (866)
  • Get the First and Last Word from a String or Sentence in SQL (837)
  • How to select distinct rows in a datatable in C# (806)
  • How to make theater mode the default for Youtube (757)
  • Add Constraint to SQL Table to ensure email contains @ (578)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (564)
  • Average of all values in a column that are not zero in SQL (535)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (491)
  • Find numbers with more than two decimal places in SQL (449)

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries
  • SQL: Use Window Functions for Advanced Analytical Queries
  • .NET Core: Use Background Services for Long-Running Tasks
  • .NET Core: Use Minimal APIs for Lightweight HTTP Services
  • Git: Use Cherry-Pick to Apply Specific Commits Across Branches
  • Git: Use Interactive Rebase to Clean Up Commit History Before Merge

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (950)
  • How to add default value for Entity Framework migrations for DateTime and Bool (866)
  • Get the First and Last Word from a String or Sentence in SQL (837)
  • How to select distinct rows in a datatable in C# (806)
  • How to make theater mode the default for Youtube (757)

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com