Skip to content

Lakshmikanth2001/GitHooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5e24ce1 Β· Apr 9, 2024

History

49 Commits
Dec 5, 2023
Sep 27, 2023
Apr 9, 2024
Jul 16, 2023
Dec 2, 2023
Oct 18, 2022
Jul 22, 2023
Apr 9, 2024
Oct 18, 2022
Sep 27, 2023
Sep 27, 2023
Apr 9, 2024
Jul 20, 2023
Oct 18, 2022
Mar 15, 2023

Repository files navigation

Git Hooks in VS Code

If you're working on a team or collaborating with other developers, using Git hooks can be beneficial for enforcing code standards, running tests automatically, or preventing commits that don't meet certain criteria.They can help protect both your local git repo as well as hosted git repo from bad commits that could potentially break your code.

Git hooks are scripts that can be executed before or after certain Git events, such as committing changes or pushing to a remote repository. They allow you to automate tasks, enforce code quality, and perform various checks as part of your development workflow.

The GitHooks extension for Visual Studio Code provides a user interface (UI) to manage and configure Git hooks without needing to interact with the command line directly. This can make it more convenient and accessible for developers who prefer a visual interface for managing their Git hooks.

Features

  • View Git Hooks in the current workspace
  • Activate git hooks in the current workspace
  • Edit git hook in the current workspace
  • Configures git hooks path (i.e., git config core.hooksPath) in the current workspace

Run Git Hooks

Git Hooks Configuration

  • GitHooks.hooksDirectory
    • Change GitHooks.hooksDirectory to configure your local git hooks to the required path
  • GitHooks.viewContainerDisplay
    • To toggle between SCM and Activity Bar view
  • GitHooks.predefinedHooks
    • List of hooks which are defined by git. If a file not in this list is present in hooksDirectory, a vscode 'testing-error-icon' will be displayed beside it
  • GitHooks.languageBinaries
    • This configuration is used to suggest various shell paths and shebang text input for various language binaries like (python, python3, node) etc. Their path is computed via a bash command which python

Various Shell path suggetions

Git Hooks in VS Code Source Control

  • Toggle Git Hooks view between activity bar and SCM view using git icon on the top right

Git Hooks Layout

Git Hooks Description

Contributors

A big thanks to the people who have contributed to this project πŸ™πŸ½πŸ™πŸ½πŸ™πŸ½πŸ‘¨πŸ½β€πŸ’»πŸ§‘πŸ½β€πŸ’»:

  • ChatGPT (@ChatGPT) for improving README.md
  • GitHub Copilot (@ChatGPT) for improving code quality and suggesting various code snippets

By Reporting Issues and Bugs

AquilaSands and ionutz89 (@AquilaSands) and (@ionutz89) β€” Bug

Paul-Joseph de Werk (@DraakUSA) β€” Bug

Ahmad M (@9AMTech) β€” Bug