How to Initiating git through ssh
Git Cheat Sheet
step 1 : login into ssh
//login using shh $ ssh username@host.com
step 2 : create a folder using mkdir commend and change to that folder
// creating a folder $ mkdir folder_name //changing to that newly created folder $ cd folder_name
step 3 : write below comment to initiate as a master branch
// initiating as a master branch $ git init --bare
step 4 : change window.pack to 0
//changing the windows pack $ git config pack.window 0
step 5 : clone to local machine using
//cloning the newly created folder to local $ git clone username@host.com:/home/folder_name
step 5 : make changes create a read me file and commit
// adding the all files which are created $ git add . // committing all the changes $ git commit -am "initial commit "
step 6 : push server
// pushing the committed changes $ git push origin master //before that make sure you take a pull from server git pull origin master $ git pull origin master
step 7 : To auto update in server go to
git_folder/hooks/post-update.sample and rename to post-update and the past this code (change the folder name to targeted folder)
cd ~/public_html/folder|| exit unset GIT_DIR git pull origin master exec git-update-server-info