Urgent.News

What's breaking now, across hundreds of outlets.

Tech

How to Configure Git Hooks: Stop Pushing Secrets and Broken Commits

The first time I watched a teammate push an AWS access key to a public GitHub repo, I learned two things. First, GitHub's secret scanning alerts are fast - we got the email in 47 seconds. Second, the team had a pre-commit hook that should have caught it. It just wasn't installed on her laptop, because hooks don't sync with the repo, and nobody had set up a way to make them sync. The four hours we…

Git hooks are scripts that run at specific points during Git's workflow, such as during commit, push, or receive operations. They can help prevent mistakes like pushing secrets or broken commits. However, by default, Git hooks are local, meaning each developer must install them manually, which often leads to inconsistencies across the team.

To address this, modern approaches use a version-controlled directory called .githooks/ for hooks, ensuring consistency across all machines. Git hooks come in various types, including client-side and server-side hooks, each running at different stages of the Git workflow. While client-side hooks can be bypassed, server-side hooks enforce policies that cannot be bypassed.

Teams should use both client and server-side hooks to achieve the best protection. Setting up Git hooks involves prerequisites like Git 2.36+ and having a secret scanner. The pre-commit framework, written in Python, is a popular tool for managing hooks declaratively. It allows teams to define their hooks in a .pre-commit-config.yaml file and install them using a single command, ensuring all developers have the same hooks installed.

After installation, Git hooks run automatically during the commit process, helping to catch and prevent mistakes like pushing secrets or broken commits.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Does Europe have a cybersecurity problem? | Password

According to experts, the cybersecurity incidents Europe experienced in November should not come as a surprise. But how much do we know about these attacks?

  • November 2026 saw European supermarket refrigeration systems targeted in cyberattacks.
  • Belgian authorities suspect Iran, but lack evidence to confirm.
  • European Commission data breach exposed employee personal information.

OpenTelemetry Collector Kubernetes setup for Dynatrace: Helm, Operator and k8sattributes

Your pods send OpenTelemetry traces, but in Dynatrace they arrive with no pod name, no namespace and no node. You cannot tie a latency spike to a specific deployment, and MTTR grows.

  • Deploy OpenTelemetry Collector DaemonSet in Kubernetes cluster
  • Add k8sattributes processor to include pod names, namespaces, and nodes
  • Export traces, metrics, and logs to Dynatrace SaaS or Managed over OTLP

What a published pricing formula lets you verify in five minutes

Two weeks ago a procurement lead forwarded a PDF with one number circled: a per-token rate, described as "discounted". She asked a fair question — is this good? I could not answer from the PDF.

  • Locate vendor's list price for input and output tokens on their website
  • Apply coefficient to both numbers, multiplying them together
  • Compare calculated rate against published row to verify pricing formula

More from Friday 27 November →