UsingĀ git to deploy your website to your remote server
-
ssh into your server and make a directory.
mkdir -p /var/repo/website.git -
cd /var/repo/website.git/
git init --bare
-
cd hooks
nano post-receive
-
#!/bin/sh
git --work-tree=path_to_website_folder --git-dir=path_to_git_directory checkout -f name_of_branch
-
chmod +x post-receive
- git init git remote add name_of_repository ssh://your_user@
server_ip_address/
path_to_git_directory git push name_of_repository name_of_branch
Facebook Comments