Create a Remote Git repository


At your server:

Commands:

ssh test@server.com// user: test server: yourserver.com or ip address

mkdir gitrepo.git// Project name: gitrepo.git

git init –bare

git update-server-info

Change git working tree ( where real project will be stores when you push from local )

cd gitrepo.git/hooks

vim post-receive

GIT_WORK_TREE=/home/{Your username}/{project_name} //You can give your folder structure.

P.S: Assusmed that you have linux server and git in sever

Al Local folder:

Go to your local git repo

git remote add origin test@server.com:/{You location of gitrepo.git}

e.g: git remote add origin test@server.com:/home/test/gitrepo.git

Then commit your changes, Push your changes

 git push -u origin master

About sathia

Web developer at cloudmint
This entry was posted in Uncategorized and tagged , , , , , . Bookmark the permalink.

Leave a comment