Git on the Centos Server
/*******
* SERVER
********/
Login in to your server:
ssh login@yourdomainname.com
Install git package:
$ sudo yum install git
Create user folder and nessesery files:
$ sudo adduser git
$ su git
$ cd
$ mkdir .ssh && chmod 700 .ssh
$ touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys
Create empty repository:
$ mkdir repository_name.git
$ cd repository_name.git
$ git init -bare
$ logout
/*********
LOCAL MACHINE
***********/
On your local machine:
Clone your repository
$ git clone git@oldrepository_url:repository_name
Push your repository to new server
$ git push –mirror git@yourdomainname:repository_name
Change settings in your local repository
git remote set-url origin git@yourdomainname:repository_name
git push –set-upstream origin master