{"action":"created","comment":{"url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/pulls/comments/22794798","id":22794798,"diff_hunk":"@@ -0,0 +1,151 @@\n+#Git workflow\n+Описание текущего git workflow принятого у нас на вооружение.\n+\n+##Основные ветки\n+Всю работу которую мы осуществляем можно условно разделить на две стадии:\n+\n+* До релиза продукта\n+* После релиза продукта\n+\n+В плане git основное различие будет заключаться в том, как используется ветка master, в git репозитории. До релиза она считается основной, то есть все изменения из feature branches, попадают в неё (пройдя обычную процедуру PR и code review), и уже после этого на тестовый сервер. После релиза, основной рабочей веткой становиться ветка development, код сначала попадает в неё (откуда он деплоиться на тестовый сервер), а уже после этого отправляется в master ветку из которой заливается на боевой сервер.\n+\n+##Feature branches\n+Для внесения измениня в текующую основную ветку, мы используем модель feature branches (ветка изменений). Она подразумевает, что для каждой новой функции, которая добавляется в приложение (сюда же в том числе относится и исправление предыдущих ошибок) создается новая ветка, изменения из которой, после проведённого code review уже попадают в основную ветку.\n+\n+Кроме этого основного преимущества, есть ещё один немаловажный момент, который заключается в возможности обсуждения каких-либо сложностей, возникших в ходе разработки без внесения изменения в основную ветку.\n+\n+##Сценарий разработки\n+Зачастую, наша работа с git репозиторием будет начинаться с того, что мы будем его клонировать к себе на рабочую машину. Делается это очень простым образом:\n+\n+```\n+git clone ssh://user@domain.tld/repo.git <name>\n+```\n+\n+При этом, параметр `name` носит не обязательный характер. Он обозначает, как будет называться папка, в которой будет располагаться склонированный репозиторий. Если данный параметр не задан, то тогда название папки будет равняться названию нашего репозитория.\n+\n+Следующим действием мы создаем локальную ветку для внесения изменений. Порядок действий будет зависеть от того, в какой стадии находится проект. Если до релиза проекта:\n+\n+```\n+git checkout master\n+```\n+\n+Если после релиза проекта, когда работа идёт уже в development ветке:\n+\n+```\n+git checkout development\n+```\n+\n+Последующие команды одинаковы и для того и для другого случая:\n+\n+```\n+git pull\n+git checkout -b <branch-name>\n+```\n+\n+Этими действиями мы создаем новую локальную ветку, в которой можем вести разработку.\n+\n+Далее у нас идёт непосредственно сам процесс написания кода и внесения различных изменений, которые необходимо будет после того, как они будут сделаны, отправить в общий репозиторий. Это делается при помощи следующего набора команд:\n+\n+```\n+git add -A\n+git commit\n+git push\n+```\n+\n+`git add -A` — подготавливаем все изменённых файлы к отправке в репозиторий\n+`git commit` — после того как файлы готовы, на необходимо их закомитить. Этой командой мы вызов текстовый редактор, который в котором мы можем набрать сообщение к этому коммиту. Альтернативой можно рассматривать команду `git commit -m <message>`, где <message> будет являться сообщением к комиту. Про правильные сообщения к комитам можно прочитать в соответствующем разделе.\n+`git push` — собственно отправка изменений.\n+\n+Из этой простой последовательности могут быть исключения. Одно из них — если вы работаете вместе с кем-то над одной веткой изменений.\n+\n+```\n+git add -A\n+git stash\n+git pull\n+git stash pop\n+git commit\n+git push\n+```\n+\n+`git add -A` — подготавливаем все изменённые файлы\n+\n+`git stash` — прячем сделанные изменения. При этом они убираются из рабочей ветки, но никуда не деваются. Это позволяет без проблем осуществить следующий этап.\n+\n+`git pull` — проверяем, есть ли сервере какие-либо изменения в коде, которых нет у нас.\n+\n+`git stash pop` — достаем спрятанные изменения и удаляем их копию из stash\n+\n+`git commit` — так как все изменения уже подготовлены, мы можем без проблем их закомитить.\n+\n+`git push` — отправляем изменения на сервер.\n+\n+На мой взгляд второй вариант более правильный, так как он помогает избежать нежелательных ситуаций с конфликтами. Хотя если есть уверенность, что таких ситуаций не возникнет, то тогда можно уверенно пользоваться первым вариантом.\n+\n+В целом разработка по такому сценарию, носит следующий вид:\n+\n+1. От текущей основной ветки разработки создает feature branch (ветку изменений)\n+2. Вносит необходимые изменения и создает новый код на своей локальной машине\n+3. Отправляет изменения на сервер (push)\n+4. После завершения разработки нового функционала в github создается pull request\n+5. После проверки pull request, осуществляется merge в основную векту\n+6. …\n+7. PROFIT!\n+\n+##Good commit messages или “Use the Force, Luke”.\n+Еще одни важным моментом является написание хорошего пояснительного сообщения к комиту. Ниже приводиться примерный шаблон того, как оно может выглядеть:\n+\n+```\n+Короткое сообщение с большой буквы (50 букв или меньше)\n+\n+Ниже следует более детальное разъяснение, если оно требуется.\n+При этом следует стараться выдерживать длину строки такого сообщения\n+в 72 символа. После заголовка и перед разъяснительным текстом идет пустая строка.\n+\n+* Составление списков так же допускается\n+* Иногда они могут оказаться полезными\n+```","path":"git/index.md","position":106,"original_position":106,"commit_id":"e604b6daf2c314de5766d5376a8dc4159a15f997","original_commit_id":"e604b6daf2c314de5766d5376a8dc4159a15f997","user":{"login":"Movshin","id":3601093,"avatar_url":"https://avatars.githubusercontent.com/u/3601093?v=3","gravatar_id":"","url":"https://api.github.com/users/Movshin","html_url":"https://github.com/Movshin","followers_url":"https://api.github.com/users/Movshin/followers","following_url":"https://api.github.com/users/Movshin/following{/other_user}","gists_url":"https://api.github.com/users/Movshin/gists{/gist_id}","starred_url":"https://api.github.com/users/Movshin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Movshin/subscriptions","organizations_url":"https://api.github.com/users/Movshin/orgs","repos_url":"https://api.github.com/users/Movshin/repos","events_url":"https://api.github.com/users/Movshin/events{/privacy}","received_events_url":"https://api.github.com/users/Movshin/received_events","type":"User","site_admin":false},"body":"а все равно на русском или английском языках хорошие комменты писать?","created_at":"2015-01-12T15:05:06Z","updated_at":"2015-01-12T15:05:06Z","html_url":"https://github.com/EvercodeLab/thebookofknowledge/pull/2#discussion_r22794798","pull_request_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/pulls/comments/22794798"},"html":{"href":"https://github.com/EvercodeLab/thebookofknowledge/pull/2#discussion_r22794798"},"pull_request":{"href":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/pulls/2","id":26597738,"html_url":"https://github.com/EvercodeLab/thebookofknowledge/pull/2","diff_url":"https://github.com/EvercodeLab/thebookofknowledge/pull/2.diff","patch_url":"https://github.com/EvercodeLab/thebookofknowledge/pull/2.patch","issue_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/issues/2","number":2,"state":"open","locked":false,"title":"Git workflow","user":{"login":"sergeylunev","id":1687968,"avatar_url":"https://avatars.githubusercontent.com/u/1687968?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeylunev","html_url":"https://github.com/sergeylunev","followers_url":"https://api.github.com/users/sergeylunev/followers","following_url":"https://api.github.com/users/sergeylunev/following{/other_user}","gists_url":"https://api.github.com/users/sergeylunev/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeylunev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeylunev/subscriptions","organizations_url":"https://api.github.com/users/sergeylunev/orgs","repos_url":"https://api.github.com/users/sergeylunev/repos","events_url":"https://api.github.com/users/sergeylunev/events{/privacy}","received_events_url":"https://api.github.com/users/sergeylunev/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-12-26T11:41:25Z","updated_at":"2015-01-12T15:05:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"08460640bbe427b1842fef1eb255025d5bc29670","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/pulls/2/commits","review_comments_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/pulls/2/comments","review_comment_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/pulls/comments/{number}","comments_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/issues/2/comments","statuses_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/statuses/e604b6daf2c314de5766d5376a8dc4159a15f997","head":{"label":"EvercodeLab:git","ref":"git","sha":"e604b6daf2c314de5766d5376a8dc4159a15f997","user":{"login":"EvercodeLab","id":1304897,"avatar_url":"https://avatars.githubusercontent.com/u/1304897?v=3","gravatar_id":"","url":"https://api.github.com/users/EvercodeLab","html_url":"https://github.com/EvercodeLab","followers_url":"https://api.github.com/users/EvercodeLab/followers","following_url":"https://api.github.com/users/EvercodeLab/following{/other_user}","gists_url":"https://api.github.com/users/EvercodeLab/gists{/gist_id}","starred_url":"https://api.github.com/users/EvercodeLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EvercodeLab/subscriptions","organizations_url":"https://api.github.com/users/EvercodeLab/orgs","repos_url":"https://api.github.com/users/EvercodeLab/repos","events_url":"https://api.github.com/users/EvercodeLab/events{/privacy}","received_events_url":"https://api.github.com/users/EvercodeLab/received_events","type":"Organization","site_admin":false},"repo":{"id":4800194,"name":"thebookofknowledge","full_name":"EvercodeLab/thebookofknowledge","owner":{"login":"EvercodeLab","id":1304897,"avatar_url":"https://avatars.githubusercontent.com/u/1304897?v=3","gravatar_id":"","url":"https://api.github.com/users/EvercodeLab","html_url":"https://github.com/EvercodeLab","followers_url":"https://api.github.com/users/EvercodeLab/followers","following_url":"https://api.github.com/users/EvercodeLab/following{/other_user}","gists_url":"https://api.github.com/users/EvercodeLab/gists{/gist_id}","starred_url":"https://api.github.com/users/EvercodeLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EvercodeLab/subscriptions","organizations_url":"https://api.github.com/users/EvercodeLab/orgs","repos_url":"https://api.github.com/users/EvercodeLab/repos","events_url":"https://api.github.com/users/EvercodeLab/events{/privacy}","received_events_url":"https://api.github.com/users/EvercodeLab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EvercodeLab/thebookofknowledge","description":"When in doubt consult the book of knowledge","fork":false,"url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge","forks_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/forks","keys_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/teams","hooks_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/hooks","issue_events_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/issues/events{/number}","events_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/events","assignees_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/assignees{/user}","branches_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/branches{/branch}","tags_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/tags","blobs_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/git/refs{/sha}","trees_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/statuses/{sha}","languages_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/languages","stargazers_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/stargazers","contributors_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/contributors","subscribers_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/subscribers","subscription_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/subscription","commits_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/commits{/sha}","git_commits_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/git/commits{/sha}","comments_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/comments{/number}","issue_comment_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/issues/comments/{number}","contents_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/contents/{+path}","compare_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/merges","archive_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/downloads","issues_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/issues{/number}","pulls_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/pulls{/number}","milestones_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/milestones{/number}","notifications_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/labels{/name}","releases_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/releases{/id}","created_at":"2012-06-26T20:27:13Z","updated_at":"2014-10-24T13:00:51Z","pushed_at":"2014-12-26T12:59:35Z","git_url":"git://github.com/EvercodeLab/thebookofknowledge.git","ssh_url":"git@github.com:EvercodeLab/thebookofknowledge.git","clone_url":"https://github.com/EvercodeLab/thebookofknowledge.git","svn_url":"https://github.com/EvercodeLab/thebookofknowledge","homepage":"http://thebookofknowledge.evercodelab.com/","size":664,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"gh-pages"}},"base":{"label":"EvercodeLab:master","ref":"master","sha":"849b8a52cefd337dd18fc8b080f3999bae6a8e0f","user":{"login":"EvercodeLab","id":1304897,"avatar_url":"https://avatars.githubusercontent.com/u/1304897?v=3","gravatar_id":"","url":"https://api.github.com/users/EvercodeLab","html_url":"https://github.com/EvercodeLab","followers_url":"https://api.github.com/users/EvercodeLab/followers","following_url":"https://api.github.com/users/EvercodeLab/following{/other_user}","gists_url":"https://api.github.com/users/EvercodeLab/gists{/gist_id}","starred_url":"https://api.github.com/users/EvercodeLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EvercodeLab/subscriptions","organizations_url":"https://api.github.com/users/EvercodeLab/orgs","repos_url":"https://api.github.com/users/EvercodeLab/repos","events_url":"https://api.github.com/users/EvercodeLab/events{/privacy}","received_events_url":"https://api.github.com/users/EvercodeLab/received_events","type":"Organization","site_admin":false},"repo":{"id":4800194,"name":"thebookofknowledge","full_name":"EvercodeLab/thebookofknowledge","owner":{"login":"EvercodeLab","id":1304897,"avatar_url":"https://avatars.githubusercontent.com/u/1304897?v=3","gravatar_id":"","url":"https://api.github.com/users/EvercodeLab","html_url":"https://github.com/EvercodeLab","followers_url":"https://api.github.com/users/EvercodeLab/followers","following_url":"https://api.github.com/users/EvercodeLab/following{/other_user}","gists_url":"https://api.github.com/users/EvercodeLab/gists{/gist_id}","starred_url":"https://api.github.com/users/EvercodeLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EvercodeLab/subscriptions","organizations_url":"https://api.github.com/users/EvercodeLab/orgs","repos_url":"https://api.github.com/users/EvercodeLab/repos","events_url":"https://api.github.com/users/EvercodeLab/events{/privacy}","received_events_url":"https://api.github.com/users/EvercodeLab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EvercodeLab/thebookofknowledge","description":"When in doubt consult the book of knowledge","fork":false,"url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge","forks_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/forks","keys_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/teams","hooks_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/hooks","issue_events_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/issues/events{/number}","events_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/events","assignees_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/assignees{/user}","branches_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/branches{/branch}","tags_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/tags","blobs_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/git/refs{/sha}","trees_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/statuses/{sha}","languages_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/languages","stargazers_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/stargazers","contributors_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/contributors","subscribers_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/subscribers","subscription_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/subscription","commits_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/commits{/sha}","git_commits_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/git/commits{/sha}","comments_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/comments{/number}","issue_comment_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/issues/comments/{number}","contents_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/contents/{+path}","compare_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/merges","archive_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/downloads","issues_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/issues{/number}","pulls_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/pulls{/number}","milestones_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/milestones{/number}","notifications_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/labels{/name}","releases_url":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/releases{/id}","created_at":"2012-06-26T20:27:13Z","updated_at":"2014-10-24T13:00:51Z","pushed_at":"2014-12-26T12:59:35Z","git_url":"git://github.com/EvercodeLab/thebookofknowledge.git","ssh_url":"git@github.com:EvercodeLab/thebookofknowledge.git","clone_url":"https://github.com/EvercodeLab/thebookofknowledge.git","svn_url":"https://github.com/EvercodeLab/thebookofknowledge","homepage":"http://thebookofknowledge.evercodelab.com/","size":664,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/pulls/2"},"html":{"href":"https://github.com/EvercodeLab/thebookofknowledge/pull/2"},"issue":{"href":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/issues/2"},"comments":{"href":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/EvercodeLab/thebookofknowledge/statuses/e604b6daf2c314de5766d5376a8dc4159a15f997"}}}}