-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Husky v5 and Gitkraken #875
Comments
Thanks @nicolas-goudry! Will give this a shot now. |
@Fdawgs you're welcome, tell me if you have any problem! |
Thanks for sharing @nicolas-goudry 👍 |
Do you have solution that works on Windows too? |
@adriankwiat you can try shx for cross-platform:
|
@nicolas-goudry Do you know, is there public information from Axosoft regarding this feature request somewhere? Thanks! |
@thasmo Apart from the Slack message linked in main issue, there isn’t anything else that I know of that references this issue publicly. |
@typicode I made a small tool to auto-install husky in different project typologies, which also (optionally) addresses this issue. Could you please give it a look? ➡️ auto-husky |
I had the same issue. I solved it by using the pre-commit package to trigger the hooks, which plays nice with gitkraken. Use at your own risk: |
Sorry to reply to an old issue description, but, 7 months you say? |
Running into this issue as well. Very unfortunate. Have been very happy with GitKraken otherwise.
Does anyone know why this is the case exactly? |
Best guess; NodeGit that GitKraken is using, does not support the hookspath option. |
On Windows you can use mklink Delete the mklink /j hooks ..\.husky You can also upvote the |
I'm having this issue with the last version ( |
GitKraken support for core.hooksPath is now marked as "Planned" 🎉 |
@snebjorn Woohoo! 🎊 Thanks for the update |
Support for |
Fixing the path and running once again the installation of husky change back the path to “.husky”, which doesn't works. |
of course, it is. |
The GitKraken team is aware of this bug. They're maybe working on it. Their response is vague and non-commiting 😞
https://feedback.gitkraken.com/suggestions/191601/support-corehookspath |
You just need to use |
FYI - I am using GitKraken version 8.0.0 (x64) and it's running the Husky hooks no problem, guessing that this issue has not been fixed. The release note detailed |
You mean: this issue has been fixed. |
That doesn't work for Windows users though |
@Peterabsolon you could use |
Today updated to version 7 of the husky, kind of everything works fine, I migrated using this tool: https://github.com/typicode/husky-4-to-7 OS: Solus 4.3 ( Linux ) |
@H6LS1S as per this comment and this comment it seems to be fixed since Gitkraken 7.7.2, with an even better support on v8+. Not related to husky 7 then. I might update the original issue to provide more detailed information about everything that has been discussed in the 40+ comments here. @typicode should I close this issue, as it's not anymore an ongoing bug with latest Gitkraken versions? |
Original issue has been updated with relevant details. Closing this as it’s no longer an issue. |
- gitkraken을 사용하는 경우 필요한 스크립트 - typicode/husky#875
Disclaimer
This is no longer an issue since Gitkraken v7.7.2, as support for
core.hooksPath
has been added.However, only absolute paths are supported if you’re using Gitkraken version lower than 8.0.0. Since Gitkraken v8.0.0, relative paths from repository are also supported.
You can see the Gitkraken feature request here.
Original issue
For anyone having issues setting up Husky v5 with Gitkraken, here are some explanations about why it’s happening, and how to fix it.
As of husky v5, a custom hooks path is used (
.husky
) rather than default git’s one (.git/hooks
). This is done through setting local git configcore.hookspath
key.As of today and version 7.5, Gitkraken does not support
core.hookspath
and will use.git/hooks
folder anyway.This is a known issue of Gitkraken team that goes back as far as 7 months ago. There seems to be an existing feature request to support it, so you could show your interest on Slack if you want things to move faster.
I don’t work at Axosoft, so I’m not sure if showing interest would make this feature come earlier, but it definitely would bring some light on it!
The workaround to fix this issue is pretty simple: create a symbolic link from
.git/hooks
to husky’s directory. It may not be the best way, but it’s the only way I found.Linux / MacOS
From you project root:
$ rm -rf .git/hooks && ln -s ../.husky .git/hooks
You may add this command to your package.json
postinstall
script, alongsidehusky install
:Windows
Solution provided by @Autapomorph (see comment):
Add
shx
and then, from you project root:$ shx rm -rf .git/hooks && shx ln -s ../.husky .git/hooks
Solution provided by @snebjorn (see comment):
Use
mklink
after removing.git/hooks
folder (not tested):$ mklink /j hooks ..\.husky
As well as for Linux / MacOS solution, you may add these commands to your package.json
postinstall
script, alongsidehusky install
(if usingshx
variant, don’t forget to add it as adevDependency
to your project).All systems
You will need to reload the repository in Gitkraken if it’s already opened.
After doing so, husky’s hooks will work as expected in Gitkraken.
The text was updated successfully, but these errors were encountered: