Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git hooks in Visual Studio?

I would like to implement client-side git hook (type of commit-msg) to validate commit message. I have done a working hook - it works perfectly when using git console. But Visual Studio 2015 git build-in plugin (Team Explorer) seems not to take it into account and simply skip those hooks.

Has anyone tried to do the same with success? I read the Internet and it seems the problem is not solved, but I believie in You! :)

I want to check if commit message contain jira issue key.

like image 807
Pawel Avatar asked Dec 06 '16 08:12

Pawel


People also ask

Can you use Git with Visual Studio?

Git Repository window in Visual Studio 2019Visual Studio has a new Git Repository window, which is a consolidated view of all the details in your repository, including all of the branches, remotes, and commit histories. You can access this window directly from either Git or View on the menu bar or from the status bar.

How do I commit to Git using Visual Studio?

Just enter your commit message and then select Commit All. The equivalent command for this action is git commit -a . Visual Studio also makes it easy to commit and sync with one click by using the Commit All and Push and Commit All and Sync shortcuts.

How do I see my Git hooks?

The hooks are all stored in the hooks subdirectory of the Git directory. In most projects, that's .git/hooks .


1 Answers

As of writing, not possible.

There is a feature request for that, and you can upvote it if it's important to you: https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/4321705-enable-client-side-hooks-when-committing-code-to-a

like image 195
Jesper Rønn-Jensen Avatar answered Sep 28 '22 03:09

Jesper Rønn-Jensen