27 ноября, 2014

Git

Первое подключение к GitHub

https://github.com/

  1. Установить консоль http://git-scm.com/downloads или https://windows.github.com/
  2. Сгенениро ключи (подробнее)
  3. Публичную часть добавить на github.com (→ settings → SSH keys)
  4. добавить ssh-агент, добавить ключ к ssh-агенту (подробнее)

Проверить правильность выполненных настроек.

$ ssh git@github.com
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.

Короткая работа в гит

$ git status
fatal: Not a git repository (or any of the parent directories): .git

$ git init
Initialized empty Git repository in C:/…

$ git status
On branch master

Initial commit

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        index.html

nothing added to commit but untracked files present (use "git add" to track)

$ git add .

$ git status
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

        new file:   index.html

$ git commit
[master (root-commit) 435b6c0] first
 2 files changed, 15 insertions(+)
 create mode 100644 _notes/dwsync.xml
 create mode 100644 index.html

$ git hist
* 435b6c0 2014-07-09 | first (HEAD, master) [Maksim Zlatov]

$ git remote add origin git@github.com:Zlatov/test.git

$ git push -u origin master
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 577 bytes | 0 bytes/s, done.
Total 5 (delta 0), reused 0 (delta 0)
To git@github.com:Zlatov/test.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean

$ ls
cgi-bin  index.html

Добавить комментарий

2010–2018 Блог Максима Златова, контакты

PHP execution time: 0.0091 s.
SQL execution time: 0.0001 s. (select publication with comments)

Яндекс.Метрика