GitHooksFolderSetter 1.0.0
dotnet add package GitHooksFolderSetter --version 1.0.0
NuGet\Install-Package GitHooksFolderSetter -Version 1.0.0
<PackageReference Include="GitHooksFolderSetter" Version="1.0.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add GitHooksFolderSetter --version 1.0.0
#r "nuget: GitHooksFolderSetter, 1.0.0"
// 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
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 | 9,522 | 12/5/2021 |