GitHooksFolderSetter 1.0.0

dotnet add package GitHooksFolderSetter --version 1.0.0
NuGet\Install-Package GitHooksFolderSetter -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GitHooksFolderSetter" Version="1.0.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GitHooksFolderSetter --version 1.0.0
#r "nuget: GitHooksFolderSetter, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install GitHooksFolderSetter as a Cake Addin
#addin nuget:?package=GitHooksFolderSetter&version=1.0.0

// Install GitHooksFolderSetter as a Cake Tool
#tool nuget:?package=GitHooksFolderSetter&version=1.0.0

GitHooksFolderSetter

This project has only one goal, execute the following command: git config core.hooksPath hooks once. That way you could enforce policy on your project when executing basic Git commands.

For more information about git hooks please read this article

Installation

Just install this package from VisualStudio UI, Package manager console, or with command line:

dotnet add package GitHooksFolderSetter

Custom hooks folder is set on first build action after package installation.

You can remove the git-hook-folder.set file in the .git folder to force the package to set the hooks folder once again.

You can customize the path of the hooks folder by specifying the HooksPath variable. You have to remove the git-hook-folder.set file if the package was installed before modification.

By default, the HooksPath variable is set to hooks which means the folder will be relative to the .git folder. For example :

- .git
- hooks/
  - commit-msg
- src/
  - MyProject/
    - MyProject.csproj
  - MyProject.sln
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <HooksPath>custom_hooks</HooksPath>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="GitHooksFolderSetter" Version="1.0.0" IncludeAssets="build" />
  </ItemGroup>

</Project>

Acknowledgments

https://github.com/Nagarian/dotnethooks

https://github.com/MrLuje/dotnet-format-hook

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 7,806 12/5/2021