hookup
hookup copied to clipboard
hookup: command not found when checkout.
Hi, I've installed as mentioned in the instructions, and I get error whenever I checkout:
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree checkout master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
Switched to branch 'master'
.git/hooks/post-checkout: line 2: hookup: command not found
Completed with errors, see above
I use mac.
Any solution?
It sounds like you need to run gem install hookup again. If you already have, then you need to examine how you normally access your Ruby gem binaries: Do you use a Ruby version manager like rbenv (which I'd recommend)? If so, then follow the instructions for your Ruby version manager so you can execute the binaries. For rbenv in particular, you'll need this in your ~/.bash_profile:
eval "$(rbenv init -)"
this is my bash profile file, after the change I made:
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
eval "$(rbenv init -)"
still doesn't work.
I was to fix it by editing the post-checkout hook:
#!/bin/bash
PATH=$PATH:/usr/local/bin:/usr/local/sbin:/Users/eranlevin/.rbenv/shims:/Users/eranlevin/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sb
hookup post-checkout "$@"
maybe you can make a patch that will obviate it?
That's a passable workaround but something is still off with your rbenv config if you need it.
Yeah, all that PATH stuff should be taken care of in your shell settings (~/.bash_profile if you use Bash, the MacOS default). This is a problem with your rbenv config, not with hookup specifically.
For example, I've simplified my .bash_profile to only consist of this:
eval "$(rbenv init -)"
And hookup works in a new terminal:
$ which -a hookup
/Users/mike/.rbenv/shims/hookup
I think it's worth the time figuring this out, because it will likely affect other tools later on. I would set a goal of getting hookup to execute in a new terminal, like I did above.
More ideas:
- If you use rbenv, try running
rbenv versionsin your project directory. It could be that your directory specifies a different version of rbenv than the one where you rangem install hookup. - In case something weird happened during the gem install, try
gem uninstall hookupand thengem install hookupagain. - Try temporarily reducing your
.bash_profileto my example above, in case something there is mutating your PATH. That really should be all you need.
it seems that 2 versions are installed:
system
2.4.0
* 2.4.3 (set by /Users/eranlevin/.rbenv/version)
but the same version is installed both in global and in the project.
the which returned me:
/Users/eranlevin/.rbenv/shims/hookup
If you can run hookup from your project directory then it seems like it should work. At this point I don't know how else to help you.