Skip to content

Instantly share code, notes, and snippets.

@doozie-akshay
Created April 26, 2020 07:36
Show Gist options
  • Save doozie-akshay/e8403909c65e87ea2eda3db4c00f1158 to your computer and use it in GitHub Desktop.
Save doozie-akshay/e8403909c65e87ea2eda3db4c00f1158 to your computer and use it in GitHub Desktop.
For Website and Front end application
Online Git Push Documentation :
Open Up Putty Exe
Put hostname– example domain.com and port like 22
Login to server with your creds
After login – goto – repos floder (cd repos) / create folder repos one level above document root
Init git with git init --bare --shared project_name.git
Goto to cpanel File Manger - Repos folder
project_name.git (change file permission to 777 and save)
Double click project_name.git folder -> hooks -> add new file post-receive file name with permission 777
Add this content to post-receive file
Example –
#!/bin/sh
git --work-tree=/home/USERNAME/public_html/project_name --git-dir=/home/USERNAME/repos/project_name.git checkout -f
and below should be remote push path
Example - ssh://username@domain.com:22/home/USERNAME/repos/project_name.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment