{"id":219219,"date":"2014-04-14T03:35:02","date_gmt":"2014-04-13T23:35:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=219219"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=219219","title":{"rendered":"<span class=\"post_title\">GitHub Cheat Sheet<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0412 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u043d\u0430 \u0433\u043b\u0430\u0437\u0430 \u043f\u043e\u043f\u0430\u043b\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 <a href=\"https:\/\/github.com\/tiimgreen\/github-cheat-sheet\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a>. \u042d\u0442\u0430 \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u0441\u044f \u043f\u043e \u0441\u0430\u043c\u044b\u043c \u0442\u0430\u0439\u043d\u044b\u043c \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c Git \u0438 GitHub \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f\u043c \u0417\u0430\u043a\u0430 \u0425\u043e\u043b\u043c\u0430\u043d\u0430 <s><a href=\"http:\/\/habrahabr.ru\/post\/214761\/\">\u043e\u0434\u043d\u0443 \u0438\u0437 \u0441\u0442\u0430\u0442\u0435\u0439<\/a> \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043b<\/s> <a href=\"http:\/\/www.confreaks.com\/videos\/1229-aloharuby2012-git-and-github-secrets\">Git and GitHub Secrets<\/a> \u043d\u0430 Aloha Ruby Conference 2012 \u0438 <a href=\"https:\/\/vimeo.com\/72955426\">More Git and GitHub Secrets<\/a> \u043d\u0430 WDCNZ 2013. \u0421\u0442\u043e\u0438\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u0431\u0440\u0430\u043b \u0441\u0432\u044b\u0448\u0435 1000 \u0441\u0442\u0430\u0440\u043e\u0432 \u043c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c \u0437\u0430 12 \u0447\u0430\u0441\u043e\u0432. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432: <\/p>\n<h4>Hub \u2014 Git Wrapper<\/h4>\n<p>  <a href=\"https:\/\/github.com\/github\/hub\">Hub<\/a> \u2014 \u044d\u0442\u043e \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0430 \u043d\u0430\u0434 Git, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043b\u0438\u0448\u043d\u0435\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043b\u0430\u0432\u0438\u0448 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Git.  <\/p>\n<pre><code class=\"bash\">$ hub clone tiimgreen\/toc &gt; git clone https:\/\/github.com\/tiimgreen\/toc.git <\/code><\/pre>\n<p>  \u041d\u0430 <b>hub<\/b> \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043b\u0438\u0430\u0441 <b>git<\/b> \u0438 \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0435\u0449\u0435 \u0443\u0434\u043e\u0431\u043d\u0435\u0435:  <\/p>\n<pre><code class=\"bash\"># Remote $ git remote add rtomayko &gt; git remote add rtomayko git:\/\/github.com\/rtomayko\/CURRENT_REPO.git  #Fetch $ git fetch mislav &gt; git remote add mislav git:\/\/github.com\/mislav\/REPO.git  #Fork $ git fork [ repo forked on GitHub ] &gt; git remote add -f YOUR_USER git@github.com:YOUR_USER\/CURRENT_REPO.git <\/code><\/pre>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0432\u0435\u0442\u043a\u0430<\/h4>\n<p>  \u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c:   <\/p>\n<pre><code class=\"bash\">$ cd - <\/code><\/pre>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0442\u043a\u0430\u043c \u0432 Git:   <\/p>\n<pre><code class=\"bash\">$ git checkout - # Switched to branch 'master'  $ git checkout - # Switched to branch 'next'  $ git checkout - # Switched to branch 'master' <\/code><\/pre>\n<h4>\u0417\u0430\u043a\u0440\u044b\u0442\u0438\u0435 Issues \u043a\u043e\u043c\u043c\u0438\u0442\u0430\u043c\u0438<\/h4>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u043a\u043e\u043c\u043c\u0438\u0442\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440 Issue \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u043e\u0432\u043e \u043e\u0434\u043d\u043e\u043a\u043e\u0440\u0435\u043d\u043d\u043e\u0435 \u0441 fix\/fixes\/fixed \u0438\u043b\u0438 close\/closes\/closed:  <\/p>\n<pre><code class=\"bash\">$ git commit -m &quot;Fix cock up, fixes #12&quot; <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/389\/606\/ac2\/389606ac2cdb5611201066d3f51f7e0e.png\" alt=\"image\"\/><\/p>\n<h4>Checking out Pull Requests<\/h4>\n<p>  <\/p>\n<pre><code class=\"bash\">$ git fetch origin '+refs\/pull\/*\/head:refs\/pull\/*' <\/code><\/pre>\n<h4>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0430<\/h4>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <b>?author=username<\/b> \u0432 URL:  <\/p>\n<pre><code class=\"bash\">https:\/\/github.com\/rails\/rails\/commits\/master?author=dhh <\/code><\/pre>\n<h4>\u0421\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 Git Log<\/h4>\n<p>  <\/p>\n<pre><code class=\"bash\">$ git log --all --graph --decorate --oneline --abbrev-commit <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/261\/5d3\/5ab\/2615d35ab0035c22060ad7912fc522c0.png\" alt=\"image\"\/><\/p>\n<h4>Git Query<\/h4>\n<p>  Git Query \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0430\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u044b \u043f\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c, \u0433\u0434\u0435 \u00abquery\u00bb \u0438\u0441\u043a\u043e\u043c\u0430\u044f \u0444\u0440\u0430\u0437\u0430:  <\/p>\n<pre><code class=\"bash\">$ git show :\/query <\/code><\/pre>\n<p>  \u0418 \u0435\u0449\u0435 \u0446\u0435\u043b\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0439 \u0442\u0430\u0438\u043d\u0441\u0442\u0432 Git \u0438 GitHub \u043d\u0430 <a href=\"https:\/\/github.com\/tiimgreen\/github-cheat-sheet\">\u0413\u0438\u0442\u0445\u0430\u0442\u0435<\/a>.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0432\u0441\u0435\u043c \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.      \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/219219\/\"> http:\/\/habrahabr.ru\/post\/219219\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0412 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u043d\u0430 \u0433\u043b\u0430\u0437\u0430 \u043f\u043e\u043f\u0430\u043b\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 <a href=\"https:\/\/github.com\/tiimgreen\/github-cheat-sheet\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a>. \u042d\u0442\u0430 \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u0441\u044f \u043f\u043e \u0441\u0430\u043c\u044b\u043c \u0442\u0430\u0439\u043d\u044b\u043c \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c Git \u0438 GitHub \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f\u043c \u0417\u0430\u043a\u0430 \u0425\u043e\u043b\u043c\u0430\u043d\u0430 <s><a href=\"http:\/\/habrahabr.ru\/post\/214761\/\">\u043e\u0434\u043d\u0443 \u0438\u0437 \u0441\u0442\u0430\u0442\u0435\u0439<\/a> \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043b<\/s> <a href=\"http:\/\/www.confreaks.com\/videos\/1229-aloharuby2012-git-and-github-secrets\">Git and GitHub Secrets<\/a> \u043d\u0430 Aloha Ruby Conference 2012 \u0438 <a href=\"https:\/\/vimeo.com\/72955426\">More Git and GitHub Secrets<\/a> \u043d\u0430 WDCNZ 2013. \u0421\u0442\u043e\u0438\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u0431\u0440\u0430\u043b \u0441\u0432\u044b\u0448\u0435 1000 \u0441\u0442\u0430\u0440\u043e\u0432 \u043c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c \u0437\u0430 12 \u0447\u0430\u0441\u043e\u0432. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432: <\/p>\n<h4>Hub \u2014 Git Wrapper<\/h4>\n<p>  <a href=\"https:\/\/github.com\/github\/hub\">Hub<\/a> \u2014 \u044d\u0442\u043e \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0430 \u043d\u0430\u0434 Git, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043b\u0438\u0448\u043d\u0435\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043b\u0430\u0432\u0438\u0448 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Git.  <\/p>\n<pre><code class=\"bash\">$ hub clone tiimgreen\/toc &gt; git clone https:\/\/github.com\/tiimgreen\/toc.git <\/code><\/pre>\n<p>  \u041d\u0430 <b>hub<\/b> \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043b\u0438\u0430\u0441 <b>git<\/b> \u0438 \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0435\u0449\u0435 \u0443\u0434\u043e\u0431\u043d\u0435\u0435:  <\/p>\n<pre><code class=\"bash\"># Remote $ git remote add rtomayko &gt; git remote add rtomayko git:\/\/github.com\/rtomayko\/CURRENT_REPO.git  #Fetch $ git fetch mislav &gt; git remote add mislav git:\/\/github.com\/mislav\/REPO.git  #Fork $ git fork [ repo forked on GitHub ] &gt; git remote add -f YOUR_USER git@github.com:YOUR_USER\/CURRENT_REPO.git <\/code><\/pre>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-219219","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/219219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=219219"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/219219\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=219219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=219219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=219219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}