Skip to content
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

0 byte pre-commit because the location of the pre-commit file in the INSTALL file is incorrect #25

Open
kevin-lee opened this issue Mar 24, 2015 · 3 comments · May be fixed by #29
Open

Comments

@kevin-lee
Copy link

The location of the pre-commit the file in INSTALL file is incorrect for proper installation. So after following the installation instructions, pre-commit is added to the .git/hooks folder, yet it is an empty file (0 byte).

That's because GitHub changed the URL for user-generated content from raw.github.com to raw.githubusercontent.com. Thus curl https://raw.github.com/hybridgroup/GitHub-Wikifier/master/pre-commit results in redirection and the pre-commit becomes an empty file.

So this

https://raw.github.com/hybridgroup/GitHub-Wikifier/master/pre-commit 

should be changed to

https://raw.githubusercontent.com/hybridgroup/GitHub-Wikifier/master/pre-commit 

So if I do,

curl https://raw.githubusercontent.com/hybridgroup/GitHub-Wikifier/master/pre-commit > .git/hooks/pre-commit;

it works.

@kevin-lee
Copy link
Author

@shinokada So have you tried

curl https://raw.githubusercontent.com/hybridgroup/GitHub-Wikifier/master/pre-commit > .git/hooks/pre-commit; 
chmod +x .git/hooks/pre-commit; 

in the terminal?
if so, can you see the contents in .git/hooks/pre-commit?
I think I had the same issue as yours, but it works now after doing what I just mentioned above.

Yes, both give you the same contents when accessing through a web browser, but the result of curl is different. I got 0 byte pre-commit file with raw.github.com.

I'm also using Yosemite so I can tell you that it works on Yosemite.

@shinokada
Copy link

Thanks. It worked.

curl -Lo- https://goo.gl/C170k | bash
// add changes
git add .
curl https://raw.githubusercontent.com/hybridgroup/GitHub-Wikifier/master/pre-commit > .git/hooks/pre-commit;
git commit -m "new message"
git push  origin master
etc etc

I tried curl https://raw.githubusercontent.com/hybridgroup/GitHub-Wikifier/master/pre-commit > .git/hooks/pre-commit; first but it didn't work. Then I did curl -Lo- https://goo.gl/C170k | bash, and it worked.

Thanks again.

@kevin-lee
Copy link
Author

@shinokada Good. Glad to hear that. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants