Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Using GIT and GIThub with web hosting
This guide details the creation of a GIT repository both on your Web Hosting and on your Cloud Server Infomaniak.
Preamble
- GIT and GITHub are available by default on the two aforementioned supports.
- For additional help, contact a partner or launch a free tender — also discover the role of the host.
Creation of the GIT repository
Setting up on the server:
- The GIT repository is located at
/git_depot
- The site is located in the folder
/web/[projet]
(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/[123465789]/git_depot/[projet].git
git status
git add .
git commit -a -m "init"
git push --set-upstream origin master
git push
Cloning the site to the server directory
To do on the server:
cd
cd web
rm -r [projet]/
git clone /home/clients/[123465789]/git_depot/[projet].git [projet]/
Link to this FAQ: