مختصر تهيئة أي مشروع برمجي على متحكم الأصدارات (Git)

Installation (ubuntu):

sudo apt install git-all

=On Server

$ sudo adduser git
$ su git
$ cd
$ mkdir .ssh && chmod 700 .ssh
$ touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys

Add developers keys

$ cat /tmp/id_rsa.john.pub >> ~/.ssh/authorized_keys

=Create a project

$ cd ~
$ mkdir project.git
$ cd project.git
$ git init --bare
Initialized empty Git repository in project.git/

=On Developer’s console

$ cd myproject
$ git init
$ git add .
$ git commit -m 'initial commit'
$ git remote add origin git@gitserver:project.git
$ git push origin master

Others can do

$ git clone git@gitserver:project.git
$ cd project
$ vim README
$ git commit -am 'fix for the README file'
$ git push origin master

git config --get remote.origin.url


git remote -v	# list all remotes