Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot run hooks/post-update: No such file or directory

Tags:

git

bash

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?

like image 464
Webconstructor Avatar asked Oct 08 '14 12:10

Webconstructor


1 Answers

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

like image 82
Manasvi Batra Avatar answered Sep 18 '22 23:09

Manasvi Batra