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

Git Repositories Grow Too Fast

- 11.01.26 - ErcanOPAK comment on Git Repositories Grow Too Fast

History becomes heavy. WhyLarge binaries committed accidentally. Fix Use Git LFS early, not later.

Read More
Git

Git Hooks Improve Code Quality Automatically

- 07.01.26 - ErcanOPAK comment on Git Hooks Improve Code Quality Automatically

Manual checks are skipped. WhyHumans forget, tools don’t. Fix Use pre-commit hooks for formatting and linting.

Read More
Git

Git Rebase Feels Dangerous in Teams

- 07.01.26 - ErcanOPAK comment on Git Rebase Feels Dangerous in Teams

People avoid it entirely. WhyShared branch history risk. Fix Rebase locally, merge publicly. Clear separation prevents disasters.

Read More
Git

Git Pull Breaks Local Changes Silently

- 06.01.26 - ErcanOPAK comment on Git Pull Breaks Local Changes Silently

No conflict shown. WhyAuto-merge with rerere. FixDisable rerere temporarily.

Read More
Git

Git History Looks Clean but Bugs Exist

- 06.01.26 - ErcanOPAK comment on Git History Looks Clean but Bugs Exist

Commits look fine. WhyLogical changes bundled together. FixUse smaller, purpose-driven commits.

Read More
Git

Git Bisect Finds the Wrong Commit

- 05.01.26 - ErcanOPAK comment on Git Bisect Finds the Wrong Commit

Debugging goes nowhere. WhyNon-deterministic tests. FixStabilize tests before bisecting.

Read More
Git

Git Shows Merge Conflicts That Make No Sense

- 05.01.26 - ErcanOPAK comment on Git Shows Merge Conflicts That Make No Sense

Files look identical. WhyWhitespace or encoding differences. FixNormalize file encoding across repo.

Read More
Git

Git Hooks Break CI Unexpectedly

- 04.01.26 - ErcanOPAK comment on Git Hooks Break CI Unexpectedly

Local ok, CI fails. WhyHooks are not shared by default. FixDocument hooks or enforce via tooling.

Read More
Git

Git Reverts Remove the Wrong Code

- 04.01.26 - ErcanOPAK comment on Git Reverts Remove the Wrong Code

Undo makes things worse. WhyRevert order matters in merged branches. FixRevert merge commits carefully with parent selection.

Read More
Git

Git Pull Suddenly Breaks Local Changes

- 03.01.26 - ErcanOPAK comment on Git Pull Suddenly Breaks Local Changes

No conflicts shown. WhyRebase rewrites local commits. FixStash or commit before pulling with rebase.

Read More
Git

Git History Becomes Impossible to Understand

- 03.01.26 | 03.01.26 - ErcanOPAK comment on Git History Becomes Impossible to Understand

Commits exist, meaning is lost. WhyGeneric commit messages destroy context. FixEnforce semantic commit conventions.

Read More
Git

Git Shows Changes That Don’t Exist

- 03.01.26 - ErcanOPAK comment on Git Shows Changes That Don’t Exist

Confusing diffs. WhyCRLF vs LF normalization. FixConfigure .editorconfig.

Read More
Git

Git History Looks Clean but Lies

- 03.01.26 - ErcanOPAK comment on Git History Looks Clean but Lies

Hard to debug regressions. WhyAggressive squash merges remove context. FixAvoid squashing critical feature branches.

Read More
Git

Git Shows No Changes but Files Differ

- 02.01.26 - ErcanOPAK comment on Git Shows No Changes but Files Differ

Confusing diffs. WhyWhitespace normalization. Fix Configure .editorconfig.

Read More
Git

Git Rebase Broke Everything

- 02.01.26 | 03.01.26 - ErcanOPAK comment on Git Rebase Broke Everything

History rewritten, chaos. WhyForce-push on shared branch. Fix Only rebase local branches. 💥 Git Rebase Broke Everything History rewritten. Chaos followed. Git rebase is powerful.Used incorrectly, it’s destructive. Most Git disasters don’t come from bugs —they come from rewriting shared history. 🚨 The Core Problem git rebase rewrites commit history. That’s fine only if you’re […]

Read More
Git

Git History Looks Clean But Lies

- 01.01.26 - ErcanOPAK comment on Git History Looks Clean But Lies

Squash merges hide context. Why it mattersDebugging regressions becomes harder. TipAvoid squashing critical feature branches.

Read More
Git

Git Merge Conflicts Appear “Out of Nowhere”

- 01.01.26 - ErcanOPAK comment on Git Merge Conflicts Appear “Out of Nowhere”

Nothing changed… or did it? Why it happensLine-ending normalization (CRLF vs LF). FixConfigure .gitattributes.

Read More
Git

Git — git clean Can Delete Important Files

- 31.12.25 | 31.12.25 - ErcanOPAK comment on Git — git clean Can Delete Important Files

git clean -fd is destructive. Fix Always dry-run: git clean -n  

Read More
Git

Git — Rebase Can Rewrite Shared History

- 31.12.25 - ErcanOPAK comment on Git — Rebase Can Rewrite Shared History

Rebasing public branches breaks teammates. Rule Only rebase local, private branches.

Read More
Git

Git — git stash Can Lose Untracked Files

- 30.12.25 - ErcanOPAK comment on Git — git stash Can Lose Untracked Files

Default stash ignores untracked files. ✅ Fix git stash -u  

Read More
Git

Git — git pull Can Rewrite History

- 29.12.25 - ErcanOPAK comment on Git — git pull Can Rewrite History

Pull = fetch + merge (or rebase). ❌ Risk Unexpected conflicts or history changes. ✅ Safer Use explicit: git fetch git merge  

Read More
Git

The Time Machine: git reflog

- 29.12.25 - ErcanOPAK comment on The Time Machine: git reflog

The Problem: You did a git reset –hard and accidentally deleted code you actually needed. You think it’s gone forever. The Fix: Run git reflog. Git keeps a log of every movement of the HEAD, even commits you deleted. Find the ID of the state before you messed up and run git reset –hard <ID>. […]

Read More
Git

Git — Line Endings Break Builds Cross-Platform

- 28.12.25 - ErcanOPAK comment on Git — Line Endings Break Builds Cross-Platform

CRLF vs LF causes: failing tests weird diffs ✅ Fix Use .gitattributes.

Read More
Git

How to solve ‘Microsoft.TeamFoundation.Git.Contracts.GitCheckoutConflictException’ problem

- 17.08.24 | 16.01.26 - ErcanOPAK comment on How to solve ‘Microsoft.TeamFoundation.Git.Contracts.GitCheckoutConflictException’ problem

You are in the middle of a coding session, you realize you need to switch to a new branch, and suddenly… BAM! Visual Studio throws the dreaded Microsoft.TeamFoundation.Git.Contracts.GitCheckoutConflictException. ❌ GitCheckoutConflictException An exception occurred during the checkout process. Local changes to the following files would be overwritten by checkout: [Your-File-Path.cs] Why Does This Happen? Git is […]

Read More
Git

How to delete all commit history in github

- 27.10.23 | 27.10.23 - ErcanOPAK comment on How to delete all commit history in github

Deleting the .git folder may cause problems in your git repository. If you want to delete all your commit history but keep the code in its current state, it is very safe to do it as in the following: Checkout git checkout –orphan latest_branch Add all the files git add -A Commit the changes git commit -am […]

Read More
Git

How to solve “Fatal: Not possible to fast-forward, aborting” problem

- 03.07.22 | 03.07.22 - ErcanOPAK comment on How to solve “Fatal: Not possible to fast-forward, aborting” problem

Simply the best solution so far (make fast-forwarding off by –no-ff): git pull –no-ff Thanks to Dheeraj Kumar Rao for this useful answer.

Read More
Git

ignoring any ‘bin’ directory on a git project

- 07.01.20 - ErcanOPAK comment on ignoring any ‘bin’ directory on a git project

The way to ignore all directories called bin anywhere below the current level in a directory tree is with a .gitignore file with the pattern: bin/

Read More
Git

How to create a .gitignore file in Windows

- 07.01.20 - ErcanOPAK comment on How to create a .gitignore file in Windows

If you’re using Windows it will not let you create a file without a filename in Windows Explorer. It will give you the error “You must type a file name” if you try to rename a text file as .gitignore You can get around this Windows Explorer error by appending a dot to the filename without […]

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

Posts pagination

« Previous 1 2 3 4
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 (951)
  • How to add default value for Entity Framework migrations for DateTime and Bool (868)
  • 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 (951)
  • How to add default value for Entity Framework migrations for DateTime and Bool (868)
  • 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