Git: добавление локального репозитория в удалённый

Автор: | 27/04/2015
 

git-logoИмеется центральный репозиторий.

Пример установки описан в статье Git: свой репозиторий под NGINX +uWSGI.

Для начала работы над проектом – надо загрузить локальные файлы в центральное “хранилище”.

Создаём локальный репозиторий:

$ git init
Initialized empty Git repository in /cygdrive/c/Users/User/Documents/PyProjects/APP_manager_python/.git/

Добавляем все файлы проекта:

$ git add *
$ git status | tail -n 1
new file: APP/tmp/cl1.py

Коммитим их:

$ git commit -m "Initial commit"
[master (root-commit) 92d6c79] Initial commit
...

Создаём запись о центральном репозитории:

$ git remote add zeus http://zeus.domain.com/APP.git

Проверяем:

$ git remote -v
zeus    http://zeus.domain.com/APP.git (fetch)
zeus    http://zeus.domain.com/APP.git (push)

И добавляем в него файлы нашего проекта из локального репозитория:

$ git push zeus master
Counting objects: 5483, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5343/5343), done.
Writing objects: 100% (5483/5483), 463.89 MiB | 19.43 MiB/s, done.
Total 5483 (delta 1592), reused 0 (delta 0)
To http://zeus.domain.com/APP.git
 * [new branch]      master -> master