{"componentChunkName":"component---src-templates-single-blogpost-js","path":"/blog/git","result":{"data":{"contentfulBlogPost":{"title":"Git","slug":"git","id":"b9945c1a-93f4-5726-86ea-c6301784b50d","createdAt":"04. März 2020","category":[{"title":"Git","slug":"git","id":"995d33c2-1a26-52b1-81b1-a7c5dfefbb4c","blog_post":[{"title":"Git","slug":"git","image":{"fluid":{"src":"//images.ctfassets.net/843vngvcufpj/1u4g6T8nqZJVOpuBQzLPYD/fe986d21e63c2d4554a3f3d3686475d5/apple-laptop-notebook-office-39284.jpg?w=800&q=50"}},"id":"b9945c1a-93f4-5726-86ea-c6301784b50d","createdAt":"04. März 2020","childContentfulBlogPostContentTextNode":{"childMarkdownRemark":{"excerpt":"What is Git? Git is a revision control system. It enables you to keep track of changes made to your…"}}}]}],"content":{"childMarkdownRemark":{"html":"<h1>What is Git?</h1>\n<p>Git is a revision control system. It enables you to keep track of changes made to your source code (the code of your website). It basically means, that you can have different versions of the code of your website. For example, let's say you have a website and you want to change the layout of the frontpage. Without Git you would probably just make the changes and save the file / files and upload your new code. Some might also create a copy of the code and put the changes in a different folder and keep the old code base. With Git you can still make those changes, but you can also see where and when you made changes to your code and you don't need to make any copies, because everything is saved in a repository. You can even undo changes and revert to your old code base without making copies or saving copies. </p>\n<h2>Why you should use Git</h2>\n<p>A better overview of your Code and changes made to your Code.</p>\n<h3>Overview of Git Commands</h3>\n<p><strong>Initialize a Git repository</strong>\ngit -init</p>\n<p><strong>Check Status</strong>\ngit status</p>\n<p><strong>Add all files to the staging area</strong>\ngit add .</p>\n<p><strong>Commit changes to repository</strong>\ngit commit -m \"here you can enter a message\"</p>\n<p>git init</p>\n<p>create repository manually in GitHub</p>\n<p>$ git remote add origin <a href=\"https://github.com/user/repo.git\">https://github.com/user/repo.git</a></p>\n<h1>Set a new remote</h1>\n<p>$ git remote -v</p>\n<h1>Verify new remote</h1>\n<p>git push -u origin master</p>\n<p>git status</p>\n<p>git add . -> adds all files to staging area</p>\n<p>git status</p>\n<p>git push origin master</p>\n<p>git log --oneline\ngit revert id</p>\n<p>git diff -> show changes to file (difference)\ngit log -> show commit history</p>","timeToRead":1}}},"allContentfulCategory":{"nodes":[{"title":"Google Tag Manager","slug":"google-tag-manager","id":"d0a285b4-b818-5612-8fdc-5f325aa48eb4"},{"title":"Axios","slug":"axios","id":"36071d22-d950-5e0e-8832-52a4f31016bf"},{"title":"Redux","slug":"redux","id":"89dcb61e-1b22-5795-9618-daa15e889512"},{"title":"Express","slug":"express","id":"eff898c7-be39-553c-a199-a8b67af03038"},{"title":"Node.js","slug":"node-js","id":"0c5ec24f-7db8-5e3c-bf01-d8dc8b8c4273"},{"title":"Git","slug":"git","id":"995d33c2-1a26-52b1-81b1-a7c5dfefbb4c"},{"title":"HTML","slug":"html","id":"368ff1b9-f81e-5748-8ea5-5c257ed913f9"},{"title":"GraphQL","slug":"graphql","id":"8101a2c8-2d15-5297-bfd1-d213d77b9ce8"},{"title":"Javascript","slug":"javascript","id":"c5c3bf5b-ef37-5b26-af84-dfb083fecabf"},{"title":"styled-components","slug":"styled-components","id":"f8aeb8c8-4780-5b97-a787-f278af851268"},{"title":"Material UI","slug":"material-ui","id":"9002ca9c-ae85-58b1-abd4-d467f490bec8"},{"title":"CSS","slug":"css","id":"334376eb-4c45-5412-8b19-80f1a16d19e5"},{"title":"Gatsby","slug":"gatsby","id":"8d653418-2491-59d6-a2ef-367d1a6d0a28"},{"title":"React","slug":"react","id":"0bdfb3a0-b67b-5b9a-802a-7182aa70702b"}]}},"pageContext":{"slug":"git","title":"Git"}}}