{"id":523,"date":"2019-05-14T00:36:38","date_gmt":"2019-05-14T00:36:38","guid":{"rendered":"https:\/\/s-oneill.com\/sov02\/?p=523"},"modified":"2019-05-14T00:37:32","modified_gmt":"2019-05-14T00:37:32","slug":"git-cheatsheet","status":"publish","type":"post","link":"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/","title":{"rendered":"Git Cheatsheet"},"content":{"rendered":"\n<p>Great pdf cheatsheet for Git commands at <a href=\"https:\/\/github.github.com\/training-kit\/downloads\/github-git-cheat-sheet.pdf\">https:\/\/github.github.com\/training-kit\/downloads\/github-git-cheat-sheet.pdf<\/a><\/p>\n\n\n\n<p>Here is a brief summary <br> Start a new repository or obtain one from an existing URL<br> $ <strong>git init<\/strong> <strong>[project-name]<\/strong><br> Creates a new local repository with the specified name<br> $ <strong>git clone [url]<\/strong><br> Downloads a project and its entire version history  <\/p>\n\n\n\n<p>$ <strong>git status<\/strong><br> Lists all new or modified files to be committed<br> $ <strong>git add [file]<\/strong><br> Snapshots the file in preparation for versioning<br> $ <strong>git reset [file]<\/strong><br> Unstages the file, but preserve its contents<br> $ <strong>git diff<\/strong><br> Shows file differences not yet staged<br> $<strong> git commit -m &#8220;[descriptive message]&#8221;<\/strong><br> Records file snapshots permanently in the version history <\/p>\n\n\n\n<p><em>Side note <\/em><br><strong><em>git add <\/em><\/strong><em>. (with a dot) adds all modified and new (untracked) files in the current directory and all subdirectories to the staging area (a.k.a. the index), thus preparing them to be included in the next <\/em><strong><em>git<\/em><\/strong><em> commit. <br><br>Any files matching the patterns in the .gitignore file will be ignored by <\/em><br><strong><em>git add <\/em><\/strong><em>.<\/em><\/p>\n\n\n\n<p>$ git log<br> Lists version history for the current branch<br><\/p>\n\n\n\n<p>$ git fetch [bookmark]<br> Downloads all history from the repository bookmark<br> $<strong> git push [alias] [branch]<\/strong><br> Uploads all local branch commits to GitHub<br> $<strong> git pull<\/strong><br> Downloads bookmark history and incorporates changes<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Great pdf cheatsheet for Git commands at https:\/\/github.github.com\/training-kit\/downloads\/github-git-cheat-sheet.pdf Here is a brief summary Start a new repository or obtain one from an existing URL $ git init [project-name] Creates a new local repository with the specified name $ git clone [url] Downloads a project and its entire version history $ git status Lists all new [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[35],"tags":[],"class_list":["post-523","post","type-post","status-publish","format-standard","hentry","category-developer"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git Cheatsheet - s-oneill.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git Cheatsheet - s-oneill.com\" \/>\n<meta property=\"og:description\" content=\"Great pdf cheatsheet for Git commands at https:\/\/github.github.com\/training-kit\/downloads\/github-git-cheat-sheet.pdf Here is a brief summary Start a new repository or obtain one from an existing URL $ git init [project-name] Creates a new local repository with the specified name $ git clone [url] Downloads a project and its entire version history $ git status Lists all new [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/\" \/>\n<meta property=\"og:site_name\" content=\"s-oneill.com\" \/>\n<meta property=\"article:published_time\" content=\"2019-05-14T00:36:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-05-14T00:37:32+00:00\" \/>\n<meta name=\"author\" content=\"Me(sean)\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Me(sean)\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/\"},\"author\":{\"name\":\"Me(sean)\",\"@id\":\"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/ab11148c6ea273be80dddd8baec1a545\"},\"headline\":\"Git Cheatsheet\",\"datePublished\":\"2019-05-14T00:36:38+00:00\",\"dateModified\":\"2019-05-14T00:37:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/\"},\"wordCount\":202,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/a9217b5797251a243dfd504d7ad7d00a\"},\"articleSection\":[\"Developer\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/\",\"url\":\"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/\",\"name\":\"Git Cheatsheet - s-oneill.com\",\"isPartOf\":{\"@id\":\"https:\/\/s-oneill.com\/sov02\/#website\"},\"datePublished\":\"2019-05-14T00:36:38+00:00\",\"dateModified\":\"2019-05-14T00:37:32+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/s-oneill.com\/sov02\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Git Cheatsheet\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/s-oneill.com\/sov02\/#website\",\"url\":\"https:\/\/s-oneill.com\/sov02\/\",\"name\":\"s-oneill.com\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/a9217b5797251a243dfd504d7ad7d00a\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/s-oneill.com\/sov02\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/a9217b5797251a243dfd504d7ad7d00a\",\"name\":\"sean o\",\"logo\":{\"@id\":\"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/image\/\"},\"description\":\"Web dev over 15 years.\",\"sameAs\":[\"http:\/\/s-oneill.com\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/ab11148c6ea273be80dddd8baec1a545\",\"name\":\"Me(sean)\",\"url\":\"https:\/\/s-oneill.com\/sov02\/author\/user01\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Git Cheatsheet - s-oneill.com","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/","og_locale":"en_US","og_type":"article","og_title":"Git Cheatsheet - s-oneill.com","og_description":"Great pdf cheatsheet for Git commands at https:\/\/github.github.com\/training-kit\/downloads\/github-git-cheat-sheet.pdf Here is a brief summary Start a new repository or obtain one from an existing URL $ git init [project-name] Creates a new local repository with the specified name $ git clone [url] Downloads a project and its entire version history $ git status Lists all new [&hellip;]","og_url":"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/","og_site_name":"s-oneill.com","article_published_time":"2019-05-14T00:36:38+00:00","article_modified_time":"2019-05-14T00:37:32+00:00","author":"Me(sean)","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Me(sean)","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/#article","isPartOf":{"@id":"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/"},"author":{"name":"Me(sean)","@id":"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/ab11148c6ea273be80dddd8baec1a545"},"headline":"Git Cheatsheet","datePublished":"2019-05-14T00:36:38+00:00","dateModified":"2019-05-14T00:37:32+00:00","mainEntityOfPage":{"@id":"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/"},"wordCount":202,"commentCount":0,"publisher":{"@id":"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/a9217b5797251a243dfd504d7ad7d00a"},"articleSection":["Developer"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/","url":"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/","name":"Git Cheatsheet - s-oneill.com","isPartOf":{"@id":"https:\/\/s-oneill.com\/sov02\/#website"},"datePublished":"2019-05-14T00:36:38+00:00","dateModified":"2019-05-14T00:37:32+00:00","breadcrumb":{"@id":"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/s-oneill.com\/sov02\/git-cheatsheet\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/s-oneill.com\/sov02\/"},{"@type":"ListItem","position":2,"name":"Git Cheatsheet"}]},{"@type":"WebSite","@id":"https:\/\/s-oneill.com\/sov02\/#website","url":"https:\/\/s-oneill.com\/sov02\/","name":"s-oneill.com","description":"","publisher":{"@id":"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/a9217b5797251a243dfd504d7ad7d00a"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/s-oneill.com\/sov02\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/a9217b5797251a243dfd504d7ad7d00a","name":"sean o","logo":{"@id":"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/image\/"},"description":"Web dev over 15 years.","sameAs":["http:\/\/s-oneill.com"]},{"@type":"Person","@id":"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/ab11148c6ea273be80dddd8baec1a545","name":"Me(sean)","url":"https:\/\/s-oneill.com\/sov02\/author\/user01\/"}]}},"_links":{"self":[{"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/posts\/523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/comments?post=523"}],"version-history":[{"count":2,"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/posts\/523\/revisions"}],"predecessor-version":[{"id":525,"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/posts\/523\/revisions\/525"}],"wp:attachment":[{"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/media?parent=523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/categories?post=523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/tags?post=523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}