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

Tag: Git Hooks

Git

Git: Fix a Git Hook That Silently Stops Running After Switching to core.hooksPath Because the Old .git/hooks Scripts Are No Longer Used

- 21.10.26 - ErcanOPAK comment on Git: Fix a Git Hook That Silently Stops Running After Switching to core.hooksPath Because the Old .git/hooks Scripts Are No Longer Used

🔀 The Hook That Got Left Behind in the Old Folder core.hooksPath lets a team point Git at a shared, version-controlled hooks directory instead of the default, untracked .git/hooks folder – a genuinely good practice, since .git/hooks itself is never committed. Switching to it doesn’t migrate anything: any existing hook scripts still sitting in .git/hooks […]

Read More
Git

Git: Stop Committing Large Binary Files by Accident With a Pre-Commit Hook

- 31.08.26 - ErcanOPAK comment on Git: Stop Committing Large Binary Files by Accident With a Pre-Commit Hook

🔀 One Accidental 400MB Video File Commit – and It’s in History Forever Someone on the team accidentally commits a large binary file – a video, a database dump, a build artifact – straight into the repository. It gets caught in review and reverted in a later commit, but the repository stays bloated forever, because […]

Read More
Git

Git: Automate Workflows with Git Hooks

- 17.08.26 - ErcanOPAK comment on Git: Automate Workflows with Git Hooks

🔗 Git Hooks = Automation Power Manual checks are error-prone. Git hooks automate tasks before commits, pushes, and merges. 📝 Git Hook Setup # Navigate to hooks directory cd .git/hooks # Common hooks pre-commit # Run before commit prepare-commit-msg # Edit commit message commit-msg # Validate commit message post-commit # Run after commit pre-push # […]

Read More
Git

Git: Automate Workflows with Git Hooks

- 25.07.26 - ErcanOPAK comment on Git: Automate Workflows with Git Hooks

🔗 Git Hooks = Automation Power Manual checks are error-prone. Git hooks automate tasks before commits, pushes, and merges. 📝 Git Hook Setup # Navigate to hooks directory cd .git/hooks # Common hooks pre-commit # Run before commit prepare-commit-msg # Edit commit message commit-msg # Validate commit message post-commit # Run after commit pre-push # […]

Read More
Git

Git: Use Git Hooks to Automate Tasks on Commit, Push, Merge

- 06.06.26 - ErcanOPAK comment on Git: Use Git Hooks to Automate Tasks on Commit, Push, Merge

⚙️ Run Scripts Automatically on Git Events Run tests before commit? Lint before push? Git hooks automate anything. No more forgotten steps. 📝 pre-commit Hook #!/bin/bash # .git/hooks/pre-commit # Run linter npm run lint if [ $? -ne 0 ]; then echo “❌ Linter failed. Fix errors before commit.” exit 1 fi # Run tests […]

Read More
Git

Git: Use Git Hooks to Automate Tasks on Commit, Push, Merge

- 31.05.26 - ErcanOPAK comment on Git: Use Git Hooks to Automate Tasks on Commit, Push, Merge

⚙️ Run Scripts Automatically on Git Events Run tests before commit? Lint before push? Format code? Git hooks automate anything. No more forgotten steps. 📝 Available Hooks .git/hooks/ (create executable files) Client-side: – pre-commit # Run tests before commit (cancel if fails) – prepare-commit-msg # Edit commit message before editor opens – commit-msg # Validate […]

Read More
Git

Git Hooks Automation: Pre-commit Checks That Save Hours of Debugging

- 05.02.26 - ErcanOPAK comment on Git Hooks Automation: Pre-commit Checks That Save Hours of Debugging

Tired of catching bugs in code review? Git hooks automatically validate code before it even reaches the repository. #!/bin/bash # .git/hooks/pre-commit # Exit immediately if any command fails set -e echo “🚀 Running pre-commit checks…” # 1. Check for debugging statements echo “🔍 Checking for console.log statements…” if git diff –cached –name-only | xargs grep […]

Read More
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,055)
  • Get the User Name and Domain Name from an Email Address in SQL (981)
  • How to add default value for Entity Framework migrations for DateTime and Bool (977)
  • Get the First and Last Word from a String or Sentence in SQL (858)
  • How to select distinct rows in a datatable in C# (854)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (653)
  • Add Constraint to SQL Table to ensure email contains @ (609)
  • Average of all values in a column that are not zero in SQL (570)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (547)
  • Find numbers with more than two decimal places in SQL (475)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit
  • SQL Server: Fix ROW_NUMBER Ties Reordering Between Identical Runs
  • C#: Fix an Enum HasFlag Returning True for the Zero Value
  • WordPress: Fix Featured Images Vanishing After a CDN Migration
  • Photoshop: Fix Content-Aware Fill Smearing a Repeating Pattern
  • Asp.Net Core: Fix Antiforgery Tokens Rejected Behind a Reverse Proxy

Most Viewed Posts

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

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit

Social

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