{"id":471,"date":"2021-04-27T18:44:18","date_gmt":"2021-04-27T18:44:18","guid":{"rendered":"https:\/\/avantutor.com\/blog\/?p=471"},"modified":"2023-02-26T21:48:26","modified_gmt":"2023-02-26T21:48:26","slug":"create-git-repository-and-push-to-github","status":"publish","type":"post","link":"https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/","title":{"rendered":"Create Git Repository and Push Your Code to it ?\u200d?\ufe0f"},"content":{"rendered":"\n<p>So you are a coding Bootcamp ? student and you need to push your local code to a repository on your GitHub account. I assume you have a GitHub account and <strong>have<\/strong> it set up <strong>already<\/strong>. If not, that&#8217;s OK. Here is a link to how to do that: https:\/\/git-scm.com\/book\/en\/v2\/Getting-Started-Installing-Git <\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Create &amp; Push a Repository to GitHub - Short &amp; Simple Edition 2021\" width=\"676\" height=\"380\" src=\"https:\/\/www.youtube.com\/embed\/7JeL-3sk3F4?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Well, let&#8217;s get started.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1) Create Repository<\/h2>\n\n\n\n<p>Login into GitHub and create a repository<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-10.50.22-AM-1024x150.png\" alt=\"\" class=\"wp-image-473\" width=\"940\" height=\"137\" srcset=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-10.50.22-AM-1024x150.png 1024w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-10.50.22-AM-300x44.png 300w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-10.50.22-AM-768x112.png 768w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-10.50.22-AM-1536x224.png 1536w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-10.50.22-AM-600x88.png 600w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-10.50.22-AM-945x138.png 945w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-10.50.22-AM.png 1780w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><figcaption>Create repo screenshot<\/figcaption><\/figure><\/div>\n\n\n\n<p>You can do so by either clickin the green button on the left (once you have logged in) or the drop down box with the &#8216;+&#8217; symbol at the top right.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2) Specify Repository Options<\/h2>\n\n\n\n<p>Name your repository and do not check any of the checkboxes. Keep your name short and simple and apply the same naming every-time you create a new repository or folder\/files for that matter.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-10.58.34-AM.png\" alt=\"\" class=\"wp-image-474\" width=\"706\" height=\"723\" srcset=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-10.58.34-AM.png 739w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-10.58.34-AM-292x300.png 292w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-10.58.34-AM-600x615.png 600w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"> Step 3) Run Commands in Terminal <\/h2>\n\n\n\n<p>Open up a terminal. CD (change directory) into the directory where you have your code. Don&#8217;t do this in the wrong directory. Bad things happen when you do! Once you are in the right directory run the following commands. For the second command use a dot (.)<\/p>\n\n\n\n<p>You can replace first commit message with anything that describes why you are pushing this change up to your Repo. Although there is a 99.99% chance first commit is appropriate.  <\/p>\n\n\n\n<p><code>git init<\/code><\/p>\n\n\n\n<p><code>git add .<\/code><\/p>\n\n\n\n<p><code>git commit -m \"first commit\"<\/code><\/p>\n\n\n\n<p><code>git branch -M main<\/code><\/p>\n\n\n\n<p><code>git remote add origin &lt;REPLACE THIS WITH THE URL, WITHOUT THE BRACKETS><\/code><\/p>\n\n\n\n<p><code>git push -u origin main<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-11.06.39-AM-1024x573.png\" alt=\"\" class=\"wp-image-475\" width=\"780\" height=\"436\" srcset=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-11.06.39-AM-1024x573.png 1024w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-11.06.39-AM-300x168.png 300w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-11.06.39-AM-768x430.png 768w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-11.06.39-AM-600x336.png 600w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-11.06.39-AM-945x529.png 945w, https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-27-at-11.06.39-AM.png 1238w\" sizes=\"(max-width: 780px) 100vw, 780px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3) Announce Your Win ? <\/h2>\n\n\n\n<p>The last step is to slack your group and let them know you are done<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/media.giphy.com\/media\/xNBcChLQt7s9a\/giphy.gif\" alt=\"\" width=\"455\" height=\"455\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>So you are a coding Bootcamp ? student and you need to push your local code to a repository on your GitHub account. I assume you have a GitHub account and have it set up already. If not, that&#8217;s OK&#8230;. <a class=\"more-link\" href=\"https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":476,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[36,44],"tags":[66,63,65,64],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create Git Repository and Push Your Code to it ?\u200d?\ufe0f - AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding<\/title>\n<meta name=\"description\" content=\"You just want to create a Git repository and push your local code to it. In this simple and short tutorial will show how to do exactly that!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create Git Repository and Push Your Code to it ?\u200d?\ufe0f - AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding\" \/>\n<meta property=\"og:description\" content=\"You just want to create a Git repository and push your local code to it. In this simple and short tutorial will show how to do exactly that!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/\" \/>\n<meta property=\"og:site_name\" content=\"AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-27T18:44:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-26T21:48:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Create-Push-Thumbnail.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"avansardar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"avansardar\" \/>\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\":\"WebPage\",\"@id\":\"https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/\",\"url\":\"https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/\",\"name\":\"Create Git Repository and Push Your Code to it ?\u200d?\ufe0f - AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding\",\"isPartOf\":{\"@id\":\"https:\/\/avantutor.com\/blog\/#website\"},\"datePublished\":\"2021-04-27T18:44:18+00:00\",\"dateModified\":\"2023-02-26T21:48:26+00:00\",\"author\":{\"@id\":\"https:\/\/avantutor.com\/blog\/#\/schema\/person\/3a1820bcdd71870ace675436f371be9e\"},\"description\":\"You just want to create a Git repository and push your local code to it. In this simple and short tutorial will show how to do exactly that!\",\"breadcrumb\":{\"@id\":\"https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/avantutor.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create Git Repository and Push Your Code to it ?\u200d?\ufe0f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/avantutor.com\/blog\/#website\",\"url\":\"https:\/\/avantutor.com\/blog\/\",\"name\":\"AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding\",\"description\":\"Looking for expert advice on how to improve your coding skills? The AvanTutor blog provides a wealth of resources and insights to help you become a better programmer. Our experienced tutors share tips and tricks for mastering popular programming languages such as Java, and JavaScript, as well as insights into the latest trends in software development. With regular updates and engaging content, the AvanTutor blog is your go-to resource for all things coding.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/avantutor.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/avantutor.com\/blog\/#\/schema\/person\/3a1820bcdd71870ace675436f371be9e\",\"name\":\"avansardar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/avantutor.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/81392f2a2c93b7b1c7479ed6b4115f02?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/81392f2a2c93b7b1c7479ed6b4115f02?s=96&d=mm&r=g\",\"caption\":\"avansardar\"},\"url\":\"https:\/\/avantutor.com\/blog\/author\/avansardar\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create Git Repository and Push Your Code to it ?\u200d?\ufe0f - AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding","description":"You just want to create a Git repository and push your local code to it. In this simple and short tutorial will show how to do exactly that!","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:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/","og_locale":"en_US","og_type":"article","og_title":"Create Git Repository and Push Your Code to it ?\u200d?\ufe0f - AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding","og_description":"You just want to create a Git repository and push your local code to it. In this simple and short tutorial will show how to do exactly that!","og_url":"https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/","og_site_name":"AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding","article_published_time":"2021-04-27T18:44:18+00:00","article_modified_time":"2023-02-26T21:48:26+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/avantutor.com\/blog\/wp-content\/uploads\/2021\/04\/Create-Push-Thumbnail.png","type":"image\/png"}],"author":"avansardar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"avansardar","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/","url":"https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/","name":"Create Git Repository and Push Your Code to it ?\u200d?\ufe0f - AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding","isPartOf":{"@id":"https:\/\/avantutor.com\/blog\/#website"},"datePublished":"2021-04-27T18:44:18+00:00","dateModified":"2023-02-26T21:48:26+00:00","author":{"@id":"https:\/\/avantutor.com\/blog\/#\/schema\/person\/3a1820bcdd71870ace675436f371be9e"},"description":"You just want to create a Git repository and push your local code to it. In this simple and short tutorial will show how to do exactly that!","breadcrumb":{"@id":"https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/avantutor.com\/blog\/create-git-repository-and-push-to-github\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/avantutor.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create Git Repository and Push Your Code to it ?\u200d?\ufe0f"}]},{"@type":"WebSite","@id":"https:\/\/avantutor.com\/blog\/#website","url":"https:\/\/avantutor.com\/blog\/","name":"AvanTutor Blog - Tips, Tricks, and Resources for Mastering Coding","description":"Looking for expert advice on how to improve your coding skills? The AvanTutor blog provides a wealth of resources and insights to help you become a better programmer. Our experienced tutors share tips and tricks for mastering popular programming languages such as Java, and JavaScript, as well as insights into the latest trends in software development. With regular updates and engaging content, the AvanTutor blog is your go-to resource for all things coding.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/avantutor.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/avantutor.com\/blog\/#\/schema\/person\/3a1820bcdd71870ace675436f371be9e","name":"avansardar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/avantutor.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/81392f2a2c93b7b1c7479ed6b4115f02?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/81392f2a2c93b7b1c7479ed6b4115f02?s=96&d=mm&r=g","caption":"avansardar"},"url":"https:\/\/avantutor.com\/blog\/author\/avansardar\/"}]}},"_links":{"self":[{"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/posts\/471"}],"collection":[{"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/comments?post=471"}],"version-history":[{"count":1,"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/posts\/471\/revisions"}],"predecessor-version":[{"id":477,"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/posts\/471\/revisions\/477"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/media\/476"}],"wp:attachment":[{"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/media?parent=471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/categories?post=471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/avantutor.com\/blog\/wp-json\/wp\/v2\/tags?post=471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}