git server setup

In the git server, create a new git user, ie

sudo git install git-core
sudo adduser git

create ssh dir under the git user and add your keys to it

su - git
mkdir .ssh
touch ~/.ssh/authorized_keys
chmod 700 ~/
chmod 600 /home/git/.ssh/*

* add any keys that you want to have access to ~/.ssh/authorized_keys after that.

To create new repo as a git user

cd ~
mkdir newrepo.git
cd newrepo.git
git init --bare

now in the client server, we want to do our first push to the remote server

git remote add origin git@server:newrepo.git
(assuming you already have all your files committed)
git push origin master
Like it.? Share it:

Comments are closed.