Knowledge base

1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!

Using GIT and GitHub with Web Hosting

This guide details the creation of a GIT repository on your Web Hosting as well as on your Infomaniak Cloud Server.

 

Preamble

 

Creation of the GIT repository

Setup on the server:

  • the GIT repository is on /git_depot
  • the site is located in the folder /web/[project] (on your FTP server)

Commands to enter:

cd
mkdir git_depot
cd git_depot/
git init --bare [projet].git
cd [projet].git
git update-server-info

 

Sending the local repository to the server

To do on the local machine:

git init
git remote add origin ssh://user@[xxxxx].ftp.infomaniak.com:/home/clients/[123456789]/git_depot/[projet].git
git status
git add .
git commit -a -m "init"
git push --set-upstream origin master
git push

 

Cloning the site on the server directory

To do on the server:

cd
cd web
rm -r [projet]/
git clone /home/clients/[123465789]/git_depot/[projet].git [projet]/

Has this FAQ been helpful?