0

My webhost has cPanel and I can access Git from /usr/local/cpanel/3rdparty/bin/git. I am on a Windows 7, use Git Bash, PuTTY for my stuff on the server my port to connect is 1900 not 22.

I tried to follow Using Git to manage a web site and want to use my remote to a subdomain.

I managed to setup the git init --bare on the web-server at home/usrname/public_html/subdomain/subdomain.git

but this was the first stumble:

cat > hooks/post-receive

I looked it up in the FTP and could not find such a file. Reading git-documentation it says that "the file is empty at first", so I created it, wrote

GIT_WORK_TREE=/public_html/subdomain git checkout -f

Later on I tried

GIT_WORK_TREE=/home/usrname/public_html/subdomain git checkout -f 

and tried to add the path to Git

GIT_WORK_TREE=/public_html/subdomain /usr/local/cpanel/3rdparty/bin/git checkout -f

Then I fixed the chmod for the file. Then I went to add my remote:

git remote add web ssh://usrname@domain.com:1900/home/public_html/subdomain.git

and run

git push web +master:refs/heads/master

Here I get to insert my password, so the connection is fine. No matter what I do I always end up with the same error message in Git Bash:

usrname@domain.com's password:
stdin: is not a tty
bash: git-receive-pack: command not found
fatal: Could not read from remote repository
Please make sure..... blah blah

I tried to change up my post-receive. I tried to follow Pushing and existing project into bare repo but when I run:

ssh user@ftp.domain.com:1900 which git-receive-pack

I get:

ssh: Could not resolve hostname .... no address associated with name

When I try to ´echo $path´ I get the same error.

I think my problem is that my git add remoteaddress is wrong. I can't reach the right directory to the repo? I have tried so many different settings, so many different addresses. Same result. I tried ~/public_html/subdomain/subdoimain.git and home/usr/public_html/subdomain/subdoimain.gitand some other stuff but I cannot get it right.

EDIT: I have looked at this SO post about this error on cpanel servers. Post I have tried to fallow the guide he is fallowing. The first error is when he adds the remote:

git remote add origin username@awesome.com/path/to/repo.git But i have to use git remote add origin with ssh to reach the server and then enter my password. ssh://username@awesome.com:1900/path/to/repo.git

I have tried to edit the /repo.git/config file like the post mentioned as a solution dont salve anything. I still get this very sad:

stdin: is not a tty
bash: git-receive-pack: command not found
fatal: Could not read from remote repository

Help anyone?

Community
  • 1
  • 1
  • "user@ftp.domain.com:1900" `ssh` doesn't accept a port number in this form. It's treating everything after the "@" as a hostname. Try running `ssh -p 1900 user@host ...` – Kenster Feb 20 '15 at 02:48
  • @Kenster Thank you, i runn `which git-receive-pack` and get: `stdin: is not a tty wich: no git-recieve-pack in (/usr/local/jdk/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin))` now when i run `ssh usr@ftp.domain.com 'echo $path'` i get "stdin: is not a tty" what is the next step? – blomdahldaniel Feb 20 '15 at 11:27
  • Well, `git-recieve-pack` isn't in any of the directories in your command path on the remote system. Do you know where that file is on the remote system? How is that directory normally added to your command path? – Kenster Feb 20 '15 at 17:50
  • @Kenster Hm.. When i brows in my directorys in my ftp-client i cannot find a git-recieve-pack file in my git repo. My dir (thru ftp) is /home/usr/public_html/subdomain/subdomain.git Is that what you mean? – blomdahldaniel Feb 21 '15 at 13:02
  • `bash: git-receive-pack: command not found` This error means that git on your system is trying to run a program called `git-receive-pack` on the remote system, and it's failing because it can't find that program. It's a program, part of the git software. It won't be part of your personal repository files. – Kenster Feb 21 '15 at 17:43
  • @Kenster Thank you for your time! I am verry glad you want to help me. I have got the path to git that I was given of my web hotel provider. So this is the path the git installation /usr/local/cpanel/3rdparty/bin/git. I checked the verison of git and it is 2.2.0. How can i fix the git-receive-pack ? I have acces to my server command line thru Putty. – blomdahldaniel Feb 22 '15 at 12:18
  • @Kenster any thoughts on solution? – blomdahldaniel Feb 25 '15 at 18:23
  • Here I am almost two years down the line struggling with the same thing! Did you every manage to get it right or just burn your computer like I'm about to? – Devin Norgarb Oct 13 '16 at 20:08

0 Answers0