Search code examples
gitsshovh

Deploy a GIT project on OVH "Mutualisé" (shared)


I followed this tutorial (in french), which is very well explained and understandable. I have knowledge of GIT, because I use my own server to version my projects in Gitlab.

I am asked to see the progress of a project. So I try for some days to install GIT on a shared host OVH (PRO account).

The final goal is to reproduce what is explained in the tutorial, and merge the code directly on the OVH server.

I follow the steps.

  1. I initializes the git on the server : git init --bare
  2. I then created a local folder, and I cling it to the remote git : git remote add origin ssh://[email protected]_name.com/folder/test.git
  3. Then I try to push the local code with the remote : git push origin master

And I get the following error : fatal: protocol error: bad line length character: Usin

What is this error? Why do I get this, whatever the method used?

EDIT :

$  GIT_TRACE=2 GIT_TRACE_PACKET=2 git push origin master
10:53:29.947071 git.c:348               trace: built-in: git 'push' 'origin' 'master'
10:53:29.947071 run-command.c:335       trace: run_command: 'C:\Program Files (x86)\PuTTY\plink.exe' '[email protected]_name.com' 'git-receive-pack '\''/folder/test.git'\'''
fatal: protocol error: bad line length character: Usin

EDIT 2 : Running another commands :

ssh [email protected]_name.com git-receive-pack folder/test.git
00700000000000000000000000000000000000000000 capabilities^{} report-status delete-refs side-band-64k ofs-delta
0000

Or (from the root /folder):

ssh [email protected]_name.com git-receive-pack /folder/test.git
fatal: '/folder/test.git' does not appear to be a git repository

And if I do a ls in the remote git folder :

~/folder/test.git $ ls
    branches  config  description  HEAD  hooks  info  objects  refs

Solution

  • I just tried my own tutorial (which you asked for help onto) to if it works and it still does. I believe there's an issue in the way you understand the tutorial or in your Windows Git configuration.

    Here's what I did step by step:

    Supposing you have a git folder in your OVH's server home dir. On my local machine:

    $ mkdir test.git
    $ cd test.git
    $ git init --bare
    $ cd ..
    $ scp -r test.git {user}@ssh.cluster{XXX}.ovh.net:git
    $ rm -rf test.git
    

    If you already having issues here, there's definitely something wrong with your Git config. Then, let's use the newly created repo:

    $ git clone {user}@ssh.cluster{XXX}.ovh.net:git/test.git
    

    That's it.

    I don't have any specific Git configuration that says whether to use HTTPS over SSH or such.

    Keep in mind that, as far as I remember, the OVH server hasn't access to the outside world unless by FTP and SSH. You might want to verify this tho.