Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

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: Fix a Cherry-Pick Dropping a Rename Across Two Branches

- 21.11.26 - ErcanOPAK comment on Git: Fix a Cherry-Pick Dropping a Rename Across Two Branches

πŸ”€ Git: Fix a Cherry-Pick Dropping a Rename Across Two Branches git cherry-pick replays a commit’s diff against the current branch using a three-way merge against that commit’s parent. If a file was renamed on the target branch after the two branches diverged, Git’s rename detection during the cherry-pick’s internal merge can fail to connect […]

Read More
Git

Git: Fix a Submodule Pointing to a Commit That No Longer Exists

- 21.11.26 - ErcanOPAK comment on Git: Fix a Submodule Pointing to a Commit That No Longer Exists

πŸ”€ Git: Fix a Submodule Pointing to a Commit That No Longer Exists A Git submodule reference stores a specific commit SHA, not a branch. If that commit is later removed from the submodule’s own remote history — a force-push that rewrites history, a branch deleted after a squash-merge, or the submodule repository being migrated […]

Read More
Git

Git: Fix a Partial Clone Missing Blobs During a Rebase

- 20.11.26 - ErcanOPAK comment on Git: Fix a Partial Clone Missing Blobs During a Rebase

πŸ”€ Fix a Partial Clone Fetching Blobs One at a Time During a Rebase A partial clone made with –filter=blob:none defers downloading file contents until something actually needs them, which works well for a normal checkout that fetches blobs on demand as you switch branches. An interactive rebase that has to materialize many historical commits’ […]

Read More
Git

Git: Fix Worktrees Sharing a Stale Index Lock

- 20.11.26 - ErcanOPAK comment on Git: Fix Worktrees Sharing a Stale Index Lock

πŸ”€ Fix Worktrees Sharing a Stale Index Lock Every git worktree gets its own working directory and its own HEAD, but all of them still share the same underlying .git directory, its object database, and a handful of repository-wide lock files. If a process in one worktree – an IDE’s background status poll, a pre-commit […]

Read More
Git

Git: Fix a Worktree Locking a Branch Needed Somewhere Else

- 19.11.26 - ErcanOPAK comment on Git: Fix a Worktree Locking a Branch Needed Somewhere Else

πŸ”€ Fix a Worktree Locking a Branch Needed Somewhere Else `git worktree add` checks out a branch into a second working directory while registering that checkout in the main repository’s internal worktree administration, and Git enforces a rule that the SAME branch can’t be checked out in two worktrees at once. If you later try […]

Read More
Git

Git: Fix Rebase Autosquash Reordering Unrelated Commits

- 19.11.26 - ErcanOPAK comment on Git: Fix Rebase Autosquash Reordering Unrelated Commits

πŸ”€ Fix Rebase Autosquash Reordering Unrelated Commits `git rebase -i –autosquash` looks for commits whose message starts with `squash!` or `fixup!` followed by text matching an earlier commit’s subject line, and automatically moves that commit to sit right after the one it targets in the generated todo list. Its matching is a simple text match […]

Read More
Git

Git: Fix a Stash Pop Conflicting With Unrelated Untracked Files

- 18.11.26 - ErcanOPAK comment on Git: Fix a Stash Pop Conflicting With Unrelated Untracked Files

πŸ”€ Git: Fix a Stash Pop Conflicting With Unrelated Untracked Files A stash created with –include-untracked bundles untracked files into the stash alongside tracked changes, which is exactly what you want right up until a new, unrelated untracked file with the same path gets created in the working directory before you pop. Git refuses to […]

Read More
Git

Git: Fix a Merge Driver Being Ignored for One File Type

- 18.11.26 - ErcanOPAK comment on Git: Fix a Merge Driver Being Ignored for One File Type

πŸ”€ Git: Fix a Merge Driver Being Ignored for One File Type A custom merge driver registered in .gitattributes only runs when Git actually performs a genuine three-way content merge on a matching file — if the file is flagged binary, or if only one side of the merge touched it at all (letting Git […]

Read More
Git

Git: Fix a Worktree Losing Track of a Branch After a Rename

- 17.11.26 - ErcanOPAK comment on Git: Fix a Worktree Losing Track of a Branch After a Rename

πŸ”€ Git: Fix a Worktree Losing Track of a Branch After a Rename Each git worktree keeps its own administrative files under .git/worktrees/<name>/, including a HEAD pointer to the branch it has checked out, and renaming a branch with git branch -m old new from a DIFFERENT worktree than the one that actually has it […]

Read More
Git

Git: Fix a Bisect Session Stuck Skipping the Same Commit Forever

- 17.11.26 - ErcanOPAK comment on Git: Fix a Bisect Session Stuck Skipping the Same Commit Forever

πŸ”€ Git: Fix a Bisect Session Stuck Skipping the Same Commit Forever git bisect skip is meant for the occasional untestable commit, but if an entire sub-range of the remaining candidates is untestable β€” because an unrelated infrastructure break, not the bug you’re actually hunting, affected every commit in that window β€” the bisect algorithm’s […]

Read More
Git

Git: Fix a Submodule Stuck on a Detached Head After a Pull

- 16.11.26 - ErcanOPAK comment on Git: Fix a Submodule Stuck on a Detached Head After a Pull

πŸ”€ Git: Fix a Submodule Stuck on a Detached Head After a Pull Running git pull on a superproject updates the recorded submodule commit pointer in the index, but unless submodule.recurse is configured, it doesn’t check out that commit inside the submodule’s own working tree – and even when it does, the submodule lands at […]

Read More
Git

Git: Fix git blame Naming the Wrong Author After Autosquash

- 16.11.26 - ErcanOPAK comment on Git: Fix git blame Naming the Wrong Author After Autosquash

πŸ”€ Git: Fix git blame Naming the Wrong Author After Autosquash An interactive rebase with –autosquash folds fixup! commits into the commit they target, but the merged commit keeps that original commit’s author metadata by default – only the committer date changes. A teammate’s fixup that corrects a real bug in your original line gets […]

Read More
Git

Git: Fix Old Stash Changes Reapplying Because pop Didn’t Drop It

- 15.11.26 - ErcanOPAK comment on Git: Fix Old Stash Changes Reapplying Because pop Didn’t Drop It

πŸ”€ Git: Fix Old Stash Changes Reapplying Because pop Didn’t Drop It git stash pop applies the stash and deletes it from the stash list ONLY if the apply succeeds cleanly. If the pop hits a merge conflict, Git intentionally leaves the stash entry in the list — a safety net so you don’t lose […]

Read More
Git

Git: Fix .gitattributes Quietly Rewriting Old Line Endings

- 15.11.26 - ErcanOPAK comment on Git: Fix .gitattributes Quietly Rewriting Old Line Endings

πŸ”€ Git: Fix .gitattributes Quietly Rewriting Old Line Endings A .gitattributes text-normalization rule, like * text=auto, only applies its conversion the next time Git actually touches a file’s content — typically on checkout or re-add — never retroactively to blobs already committed with different line endings. Add the rule to an existing repo, and every […]

Read More
Git

Git: Fix Large Files Checking Out as Tiny Text Pointers Because Git LFS Was Never Installed on That Machine

- 14.11.26 - ErcanOPAK comment on Git: Fix Large Files Checking Out as Tiny Text Pointers Because Git LFS Was Never Installed on That Machine

πŸ”€ Fix Large Files Checking Out as Tiny Text Pointers Because Git LFS Was Never Installed on That Machine Git LFS works by replacing a large tracked file’s actual content in the repository with a small text pointer file containing an object ID and a byte size, and relying on a Git LFS client hook […]

Read More
Git

Git: Fix git diff –stat Undercounting Changes in a Text File Git Mistook for Binary

- 14.11.26 - ErcanOPAK comment on Git: Fix git diff –stat Undercounting Changes in a Text File Git Mistook for Binary

πŸ”€ Fix git diff –stat Undercounting Changes in a Text File Git Mistook for Binary Git decides whether to treat a file as text or binary using a quick heuristic: it scans roughly the first several thousand bytes of the file looking for a NUL byte, and if it finds one, it classifies the whole […]

Read More
Git

Git: Fix a Merge Conflict Marker Getting Committed by Accident Because an Editor’s Auto-Save Ran Mid-Resolution

- 13.11.26 - ErcanOPAK comment on Git: Fix a Merge Conflict Marker Getting Committed by Accident Because an Editor’s Auto-Save Ran Mid-Resolution

πŸ”€ Git: Fix a Merge Conflict Marker Getting Committed by Accident Because an Editor’s Auto-Save Ran Mid-Resolution Git leaves the literal marker lines sitting in a file the moment a merge conflict happens, and it has no idea whether those lines are still unresolved or were deliberately left there, because as far as the filesystem […]

Read More
Git

Git: Fix a Sparse-Checkout That Keeps Showing Files Outside Its Configured Patterns Because the Repository Was Cloned Before Sparse-Checkout Was Ever Turned On

- 13.11.26 - ErcanOPAK comment on Git: Fix a Sparse-Checkout That Keeps Showing Files Outside Its Configured Patterns Because the Repository Was Cloned Before Sparse-Checkout Was Ever Turned On

πŸ”€ Git: Fix a Sparse-Checkout That Keeps Showing Files Outside Its Configured Patterns Because the Repository Was Cloned Before Sparse-Checkout Was Ever Turned On Enabling sparse-checkout with git sparse-checkout init and then set tells Git which patterns should populate the working tree going forward, but it only prunes files out of a working tree that’s […]

Read More
Git

Git: Fix a git rebase -i Dropping a Commit You Never Deleted Because an Earlier ‘squash’ Line Silently Absorbed It Into the Commit Above

- 12.11.26 - ErcanOPAK comment on Git: Fix a git rebase -i Dropping a Commit You Never Deleted Because an Earlier ‘squash’ Line Silently Absorbed It Into the Commit Above

πŸ”€ Git: Fix a git rebase -i Dropping a Commit You Never Deleted Because an Earlier ‘squash’ Line Silently Absorbed It Into the Commit Above In an interactive rebase’s todo list, `squash` (or its shorter alias `s`) doesn’t delete a commit β€” it merges that commit’s changes and message into the commit immediately above it […]

Read More
Git

Git: Fix git clean -fd Deleting a File You Still Need Because It Matched .gitignore Before You Ever Added and Committed It

- 12.11.26 - ErcanOPAK comment on Git: Fix git clean -fd Deleting a File You Still Need Because It Matched .gitignore Before You Ever Added and Committed It

πŸ”€ Git: Fix git clean -fd Deleting a File You Still Need Because It Matched .gitignore Before You Ever Added and Committed It `git clean -fd` removes every untracked file and directory from the working tree β€” and critically, “untracked” includes any file that matches a `.gitignore` pattern, regardless of whether that pattern was written […]

Read More
Git

Git: Fix git bisect Repeatedly Landing on a Commit That Builds and Tests Fine Because a Flaky Test Keeps Making Bisect Mark the Wrong Side as Good or Bad

- 11.11.26 - ErcanOPAK comment on Git: Fix git bisect Repeatedly Landing on a Commit That Builds and Tests Fine Because a Flaky Test Keeps Making Bisect Mark the Wrong Side as Good or Bad

πŸ”€ Git: Fix git bisect Repeatedly Landing on a Commit That Builds and Tests Fine Because a Flaky Test Keeps Making Bisect Mark the Wrong Side as Good or Bad git bisect automates a binary search over commit history by repeatedly checking out a midpoint commit and using your good/bad answer (or a script via […]

Read More
Git

Git: Fix Every git push Failing With ‘shallow update not allowed’ After Cloning With –depth=1 Because the Remote Rejects Pushes Built on an Incomplete History by Default

- 11.11.26 - ErcanOPAK comment on Git: Fix Every git push Failing With ‘shallow update not allowed’ After Cloning With –depth=1 Because the Remote Rejects Pushes Built on an Incomplete History by Default

πŸ”€ Git: Fix Every git push Failing With ‘shallow update not allowed’ After Cloning With –depth=1 Because the Remote Rejects Pushes Built on an Incomplete History by Default A shallow clone created with –depth=1 deliberately omits almost all of the repository’s commit history, keeping only the most recent commit on each branch — it’s meant […]

Read More
Git

Git: Fix git pull Repeatedly Creating an Unwanted Merge Commit Because pull.rebase Was Never Configured and the Default Pull Strategy Is Merge

- 10.11.26 - ErcanOPAK comment on Git: Fix git pull Repeatedly Creating an Unwanted Merge Commit Because pull.rebase Was Never Configured and the Default Pull Strategy Is Merge

πŸ”€ Fix git pull Repeatedly Creating an Unwanted Merge Commit Because pull.rebase Was Never Configured and the Default Pull Strategy Is Merge Running plain git pull is shorthand for git fetch followed by git merge against the remote tracking branch, unless you’ve configured it to rebase instead. On a branch where you have local commits […]

Read More
Git

Git: Fix a Branch Refusing to Checkout Anywhere Else Because a Deleted git worktree Directory Is Still Registered in .git/worktrees

- 10.11.26 - ErcanOPAK comment on Git: Fix a Branch Refusing to Checkout Anywhere Else Because a Deleted git worktree Directory Is Still Registered in .git/worktrees

πŸ”€ Fix a Branch Refusing to Checkout Anywhere Else Because a Deleted git worktree Directory Is Still Registered in .git/worktrees git worktree add checks out a branch into a separate working directory while keeping the same repository’s object store and branch refs shared, and the main repository tracks that worktree’s existence in its own .git/worktrees […]

Read More
Git

Git: Fix a Rebase Silently Dropping a Commit Because git rebase’s Patch-Id Matching Treated It as a Duplicate of a Commit Already Upstream

- 09.11.26 - ErcanOPAK comment on Git: Fix a Rebase Silently Dropping a Commit Because git rebase’s Patch-Id Matching Treated It as a Duplicate of a Commit Already Upstream

πŸ”€ Fix a Rebase Silently Dropping a Commit Because git rebase’s Patch-Id Matching Treated It as a Duplicate of a Commit Already Upstream git rebase β€” particularly with fork-point detection β€” uses a patch-id, a hash computed from a commit’s diff content while ignoring its message and exact tree state, to detect commits already applied […]

Read More
Git

Git: Fix git bisect Blaming the Wrong Commit for a Regression That Actually Shipped in a Dependency Pinned by an Unrelated Commit In Between

- 09.11.26 - ErcanOPAK comment on Git: Fix git bisect Blaming the Wrong Commit for a Regression That Actually Shipped in a Dependency Pinned by an Unrelated Commit In Between

πŸ”€ Fix git bisect Blaming the Wrong Commit for a Regression That Actually Shipped in a Dependency Pinned by an Unrelated Commit In Between git bisect’s entire algorithm assumes whatever your good/bad check tests is a pure function of that commit’s own tree contents. If the actual regression lives in a third-party dependency β€” a […]

Read More
Git

Git: Fix a Tag Pushed to the Remote Not Showing Up in a Teammate’s Clone Because git fetch Doesn’t Fetch Tags Added After Their Last Fetch by Default

- 08.11.26 - ErcanOPAK comment on Git: Fix a Tag Pushed to the Remote Not Showing Up in a Teammate’s Clone Because git fetch Doesn’t Fetch Tags Added After Their Last Fetch by Default

πŸ”€ Git: Fix a Tag Pushed to the Remote Not Showing Up in a Teammate’s Clone Because git fetch Doesn’t Fetch Tags Added After Their Last Fetch by Default A plain git fetch only follows tags that point at commits already being pulled down as part of the normal branch-following refspec. A lightweight or annotated […]

Read More
Git

Git: Fix the Same Merge Conflict Reappearing on Every Future Merge From a Long-Lived Branch Because It Was Resolved by Blindly Taking –ours Instead of Merging Both Sides

- 08.11.26 - ErcanOPAK comment on Git: Fix the Same Merge Conflict Reappearing on Every Future Merge From a Long-Lived Branch Because It Was Resolved by Blindly Taking –ours Instead of Merging Both Sides

πŸ”€ Git: Fix the Same Merge Conflict Reappearing on Every Future Merge From a Long-Lived Branch Because It Was Resolved by Blindly Taking –ours Instead of Merging Both Sides Resolving a merge conflict with git checkout –ours <file> records that merge commit as though both sides’ changes to the file were incorporated, even though the […]

Read More
Git

Git: Fix git bisect Jumping Straight to a Verdict Without Testing Any Intermediate Commit Because the Range Only Contained Two Commits

- 07.11.26 - ErcanOPAK comment on Git: Fix git bisect Jumping Straight to a Verdict Without Testing Any Intermediate Commit Because the Range Only Contained Two Commits

πŸ”€ Git: Fix git bisect Jumping Straight to a Verdict Without Testing Any Intermediate Commit Because the Range Only Contained Two Commits git bisect works by binary-searching the commit range you give it, checking out the midpoint and asking you to mark it good or bad β€” but when the range you started with contains […]

Read More
Git

Git: Fix a Rebased Branch Pushing Clean Locally but Showing Duplicate Commits on GitHub Because the Remote Still Held the Pre-Rebase History

- 07.11.26 - ErcanOPAK comment on Git: Fix a Rebased Branch Pushing Clean Locally but Showing Duplicate Commits on GitHub Because the Remote Still Held the Pre-Rebase History

πŸ”€ Git: Fix a Rebased Branch Pushing Clean Locally but Showing Duplicate Commits on GitHub Because the Remote Still Held the Pre-Rebase History Rebasing a branch rewrites its commits with new hashes, and a plain git push afterward will simply be rejected as a non-fast-forward update, since the rewritten history no longer shares a common […]

Read More
Page 1 of 13
1 2 3 4 5 6 … 13 Next Β»

Posts pagination

1 2 3 … 13 Next »
November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

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

Recent Posts

  • Network Speed Monitor Windows Application v2.5.1
  • Ağ HΔ±zΔ± Δ°zleyici Windows UygulamasΔ± v2.5.1
  • How to make theater mode the default for Youtube
  • The AI Prompt That Audits a Function for Thread-Safety Gaps
  • Ajax: Fix a Fetch Request Caching a Response Despite No-Store
  • WordPress: Fix a Navigation Block Losing Submenu Items After Sync
  • Visual Studio: Fix CodeLens Reference Counts Stuck at Stale Numbers
  • C#: Fix a UTF-8 String Literal Behaving Differently in a Switch
  • Photoshop: Fix a Liquify Mesh Snapping Back on a Smart Object
  • The AI Prompt That Turns a Crash Dump Into a Short Repro Script

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,068)
  • Get the User Name and Domain Name from an Email Address in SQL (990)
  • How to add default value for Entity Framework migrations for DateTime and Bool (986)
  • Get the First and Last Word from a String or Sentence in SQL (865)
  • How to select distinct rows in a datatable in C# (859)

Recent Posts

  • Network Speed Monitor Windows Application v2.5.1
  • Ağ HΔ±zΔ± Δ°zleyici Windows UygulamasΔ± v2.5.1
  • How to make theater mode the default for Youtube
  • The AI Prompt That Audits a Function for Thread-Safety Gaps
  • Ajax: Fix a Fetch Request Caching a Response Despite No-Store

Social

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