Git -- new repository setup

From One-Eyed Man Wiki
Jump to navigation Jump to search

Set up new repository

Note that the URL in my case is defined via ~/.ssh/config. I write it directly into .../[repo]/.git/config.

On server, as user git:

 mkdir project.git
 cd project.git
 git --bare init

On client:

 mkdir project
 cd project
 touch .gitignore
 git init
 git add .
 git commit -m "Initial commit"
 git remote add origin
 git push origin master

Clone existing repository

On client, as regular user:

 cd ~/git
 git clone git:/home/git/project.git