How to setup git (bare repository) on shared hosting in hindi

How to setup git (bare repository) on shared hosting in hindi



I will show how to setup git on shared host. Git repository will be outside of public directory so it will not be accessible to general public . how can data be update from both local to server and server to local.

STEP 1 : SSH access
seafvuef

STEP 2 : namecheap
******************
nano .bashrc

//add at very last
PATH=$PATH:/usr/local/cpanel/3rdparty/bin
export PATH
After that, press CTRL+X , then press Y and Enter to save changes.

STEP 3 : create bare repository
mkdir prod.git && cd prod.git

STEP 4 add hook:
git init –bare
cd hooks
vim post-receive
//i: add code // git –git-dir=’/home/username/gitrepo/prod.git/.git’ –work-tree=’/home/username/public_html’ checkout -f
//ii: for save and exit
Press the ESC key
Type 😡
Press the ENTER key

//iii : make excitable
Now you want to make it executable. Run the following command
chmod +x post-receive

****************** LOCAL
Back in your local development environment.

// STEP: 6 create local git repo
git init
git remote add origin ssh://[email protected]:21098/home/username/barerepo.git
git add . && git commit -m “init commit”
git push –set-upstream origin master

2 thoughts on “How to setup git (bare repository) on shared hosting in hindi

  1. How can I push a bare repository into git. I was doing svn to git migration and one of the steps included me to create a bare repository and finally use git push bare command.
    But it always shows issue that nothing to add.

Leave a Reply

Your email address will not be published. Required fields are marked *