---
title: "Discussion on \"How to Prevent a file to be overwritten in a Git Repo?\" | Hashnode"
description: "Discussion on \"How to Prevent a file to be overwritten in a Git Repo?\". Let's see how can we use Hooks in Git to add some automated checks before committing any file!"
url: "https://hashnode.com/posts/prevent-changes-in-git-using-hooks/60c604cb4e04b16f76730aa9"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Prevent a file to be overwritten in a Git Repo?](https://blogs.kratik.dev/prevent-changes-in-git-using-hooks?utm_source=hashnode&utm_medium=feed)

Let's see how can we use Hooks in Git to add some automated checks before committing any file!

Jun 13, 2021 · 4 min read · blogs.kratik.dev  
Updated Dec 3, 2021  
Read the article

-   [#git](https://hashnode.com/tag/git)
-   [#productivity](https://hashnode.com/tag/productivity)
-   [#automation](https://hashnode.com/tag/automation)
-   [#development](https://hashnode.com/tag/development)
-   [#version-control](https://hashnode.com/tag/version-control)

## Written by

[Kratik Jain](https://hashnode.com/@k4kratik)

@k4kratik · India

  
[View profile](https://hashnode.com/@k4kratik)

Infrastructure Engineer

Hey, Y'all 👋 Kratik Here :) Hailing from The City of Lakes, India. I love to learn and share stuff about DevOps, SRE, Security, Cost Optimization, etc. Join me on this journey where we will learn together with the help bunch of interesting blogs.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
