Thx to this http://danbarber.me/using-git-for-deployment/ great article I managed to have a remote server under git control.
Unfortunatly I had to change server.
Now after finishing all steps in the tutorial and running
git push origin master
I get:
error: cannot run hooks/post-update: No such file or directory
To [email protected]:../var/git/myproject.git
I 've tried many times and variations. I replaced
#!/bin/sh
for
#!/bin/bash
after reading Git - remote: error: cannot run hooks/post-receive: No such file or directory
Anyway as far as I checked ( multiple times ) the paths are correct.
I am wondering why it says :../var instead of :/var but I do not have any idea where this comes from.
Any suggestions on how to make this work again?
If you have given 777 permissions and the issue still exists it is because there might be carriage returns(^M) in the script file, if you had copied the text from vim.
To view if this is the issue: cat -v /path/file
And if this is the issue you can simply solve it by sed -i -e 's/\r//g' /path/file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With