[LINUX] Update the XSERVER website with Git push (Note)

Enable the XSERVER website with the git push command. It's also a good training to learn Git and SSH public key authentication. Thank you to all the people on the site for your reference.

Environment and preparation

System image

Create the production repository created on Public_html with XSERVER as the Remote Repository, and the bare-repository created in the directory for each server as the clone. A system in which the hooks of bare are detected by pushing from Local to bare-repository, post-receive is activated, the production repository pulls, and the data of bare is brought to the production repo. Recognized that a bare-repository is prepared and managed to avoid the risk of working with git in public_html.


--Create SSH key (prepared locally) Since the key will be reused on github and XSERVER later, it is convenient to push at the same time. --Create SSH config --Ssh connect to XSERVER and install git --Git init to Public_html, create production nonbare-repository, git init --Create bare-repository in the same hierarchy as public_html with git clone --Create post-receive in bare-repository hooks --Go to your local working folder and add bare-repository as remote-repo. --Push test from local and check the update contents in public_html

Push to github at the same time And if the pull destination is set to github

--Register SSH public key on github, link repo in github with git remote set-url --add. (Simultaneous push) --Set the remote destination of git pull to github 1. git remote rm origin 2. git remote add origin [email protected]: ~~~~~~ / ~~~~~~ (SSH connection path) 3. git remote set-url --add origin xsrv:~/~~~/~~~

Reference URL

-Let's create an environment that can be automatically deployed to the production environment with git push! -GitHub starting today -Procedure to install git on XSERVER -Procedure to install Git on X server -Procedure to create private / public key

Recommended Posts

Update the XSERVER website with Git push (Note)
Note: Prepare the environment of CmdStanPy with docker
(Note) Importing Excel with the same column name
[Note] Export the html of the site with python.
git with subprocess.Popen
[Linux] Execute git pull regularly with the crontab command
Transit to the update screen with the Django a tag
Display / update the graph according to the input with PySimpleGui
Note calling the CUDA Driver API with Python ctypes