How to initiate git through ssh

step 1 : login into ssh

step 2 : create a folder using mkdir commend and change to that folder

step 3 : write below comment to initate as a master branch

git init –bare

step 4 : change window.pack to 0

git config pack.window 0

step 5 : clone to local machine using

git clone name(if needed)

step 5 : make changes

create a read me file and commit

git add .

git commit -am “intial commit ”

step 6 : push server

git push origin master

(before that make sure you take a pull from server 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


enjoy coding

No views yet