GIT – centrální repo

převzato z GitHub

##Create a git repo with a central repository server.

Step 1: Connect to server, create a new, empty directory there and initialize an empty repository.

$ ssh
Last login ...
Welcome to!
> mkdir myrepo.git 
> cd myrepo.git
> git --bare init
Initialized empty Git repository in ~/myrepo.git
> exit

Step 2: Get into your source directory. If you did not already set up a local git repo you would have to do it now.

> cd myrepo
> git init
Initialized empty Git repository in ~/.git/

Step 3: Add the remote repository as origin repo to to your existing local git repo. Set the local master branch to track the remote branch. Then push to the server:

> git remote add origin
> git push origin master

Finally you can now clone the server repo to a new directory by a simple

> git clone

Further pushs and pulls can be done simply by call git push and git pull (origin master is not needed).

Posted in LINUX, různé