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

Автор: | 14/09/2015
 

git-logoИмеется директория проекта на локальной машине, не добавленная в Git.

Переходим в каталог:

> cd /d d:DropboxRDSrdsmanager_NG-1

Создаём пустой репозиторий:

> git init
Initialized empty Git repository in d:/Dropbox/RDS/rdsmanager_NG-1/.git/

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

> git add .
...
warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.

Выполняем первый коммит:

> git commit -m "Initial"
[master (root-commit) 6f1e3f1] Initial
...
 23 files changed, 252 insertions(+)
...

Добавляем запись о центральном репозитории:

> git remote add origin [email protected]:username/rdsmanager.git

Загружаем в него файлы:

> git push origin master
Password for 'https://[email protected]':
...
Total 23 (delta 2), reused 0 (delta 0)
To https://[email protected]/username/rdsmanager.git
 * [new branch]      master -> master

Проверяем с помощью Bibucket REST API:

> curl --user password https://bitbucket.org/api/1.0/repositories/username/rdsmanager/raw/6f1e3f1533aceda271e7a9e819b938a833aa1d68/
.idea/
lib/
unity/
RDSmanager.py
__init__.py

Готово.