{"id":5646416,"date":"2022-06-21T09:58:00","date_gmt":"2022-06-21T13:58:00","guid":{"rendered":"https:\/\/lightning.ai\/pages\/?p=5646416"},"modified":"2022-09-10T11:12:58","modified_gmt":"2022-09-10T15:12:58","slug":"version-control-using-git","status":"publish","type":"post","link":"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/","title":{"rendered":"EP 06: Version Control Using Git"},"content":{"rendered":"<p>In this Lightning Bits episode, William and Sebastian discuss why version control is useful and important for tracking code changes, and they will show you the fundamental Git workflow and commands. Watch the video, or continue reading below.<\/p>\n<p><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/mndB6zHmU3k\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h2>What is Git?<\/h2>\n<p dir=\"auto\">Version control (also known as source control) allows us to track code changes and work and collaborate on code projects effectively. In this episode, we learn the basics of Git, the version control software most people and companies use.<\/p>\n<p>You can check whether Git is already installed by executing\u00a0<code>git --version<\/code>\u00a0on the command line.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5646417 size-full\" src=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-version.png\" alt=\"Git version\" width=\"653\" height=\"308\" srcset=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-version.png 653w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-version-300x142.png 300w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-version-600x283.png 600w\" sizes=\"(max-width: 653px) 100vw, 653px\" \/><br \/>\nIf it turns out that Git is not already installed on your computer, you can download the latest version from the\u00a0<span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/git-scm.com\/downloads\" rel=\"nofollow\"><u>Git website<\/u><\/a><\/span>.<\/p>\n<h3>Git and GitHub<\/h3>\n<p>You may have heard of GitHub before, and Git and GitHub are used almost synonymous these days. However, Git is actually the program we use for version control, and GitHub is a hosting platform. Most open-source projects use both. In this episode, we will focus on Git. A following episode will then focus on GitHub as a way to host our Git projects and how to code collaboratively.<\/p>\n<h3>Essential Git Commands<\/h3>\n<p><strong>Renaming the Default Branch<\/strong><\/p>\n<p>If this is your first time using Git, we recommend executing the following command to change the global settings:<\/p>\n<pre>git config --global init.defaultBranch main<\/pre>\n<p>This will rename the default branch to\u00a0<code>main<\/code>, which is the common standard for most coding and open-source projects.<\/p>\n<p>(Note that this is something you only need to do once.)<\/p>\n<h4>1) Creating and Checking Git Repositories<\/h4>\n<ul>\n<li><code>git init<\/code>: this will create a new Git repository in the current folder.<\/li>\n<li><code>git status<\/code>: this will check the status of the current Git repository.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5646418 size-full\" src=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-status.png\" alt=\"Git status\" width=\"842\" height=\"578\" srcset=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-status.png 842w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-status-300x206.png 300w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-status-768x527.png 768w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-status-600x412.png 600w\" sizes=\"(max-width: 842px) 100vw, 842px\" \/><br \/>\nNote that\u00a0<code>git init<\/code>\u00a0will simply add an &#8220;invisible&#8221;\u00a0<code>.git<\/code>\u00a0folder to your current directory where it stores all git-related information. Other than that, it will leave your local folder and file structure unchanged. So, if you change your mind and want convert the folder back from a Git repository to a regular folder, just delete the\u00a0<code>.git<\/code> folder.<\/p>\n<p>If you see a\u00a0<code>.DS_Store<\/code> (similar to in the screenshot above), this is a file created by macOS for Finder indexing and search properties. We can ignore it here.<\/p>\n<p><strong>A Note About Invisible Files<\/strong><\/p>\n<p>On macOS, all files and folders that start with a\u00a0<code>.<\/code> (dot) are invisible in the Finder and the Terminal.<\/p>\n<p>If you want to see invisible files and folders in the Finder, you can press\u00a0<strong>Command+Shift+Dot<\/strong>. If you to these these in the terminal, use\u00a0<code>ls -a<\/code>\u00a0instead of\u00a0<code>ls<\/code>\u00a0when you are listing the directory contents.<\/p>\n<h4><a id=\"user-content-2-committing-changes\" class=\"anchor\" href=\"https:\/\/github.com\/Lightning-AI\/engineering-class\/blob\/main\/ep06-git-basics\/Ep06-ShowNotes.md#2-committing-changes\" aria-hidden=\"true\"><\/a>2) Committing Changes<\/h4>\n<p>Assume we made some changes to an existing file in the current Git repository. Now, we want to commit these changes. This is a 2-step process. First, we use\u00a0<code>git add<\/code>\u00a0and then we use\u00a0<code>git commit<\/code>.<\/p>\n<ul>\n<li><code>git add main.py<\/code>: Adds a file named\u00a0<code>main.py<\/code>\u00a0to the list of changes to be tracked for the\u00a0<code>git commit<\/code>\u00a0command.<\/li>\n<li><code>git commit -m \"my message\"<\/code>: Commit the tracked changes to the Git history with a commit message &#8220;my message&#8221;.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5646419 size-full\" src=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-commit.png\" alt=\"Git commit\" width=\"842\" height=\"452\" srcset=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-commit.png 842w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-commit-300x161.png 300w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-commit-768x412.png 768w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-commit-600x322.png 600w\" sizes=\"(max-width: 842px) 100vw, 842px\" \/><\/p>\n<h4>3) Committing All Changes<\/h4>\n<p>Above, we saw how we could track and commit individual files. However, if you have a project with many files you want to track and commit &#8212; this is true for most projects &#8212; adding files one by one can become very cumbersome.<\/p>\n<p>To track all changed files in a given directory, you can use the following modified\u00a0<code>git add<\/code>\u00a0command<\/p>\n<ul>\n<li><code>git add .<\/code>: Track all changed files in a directory<\/li>\n<li><code>git commit -m \"my message\"<\/code>: Commit tracked files (this is the same as before)<\/li>\n<\/ul>\n<p>Now, often you want to track and commit most\u00a0<strong>but not all<\/strong>\u00a0files. For example, you typically want to ignore large files. You can create a\u00a0<code>.gitignore<\/code> file and list the files to be excluded in that file.<\/p>\n<p>For that to work, all we need is a .gitignore file in the same folder as the .git repository.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5646420 size-full\" src=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/gitignore.png\" alt=\"gitignore\" width=\"800\" height=\"669\" srcset=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/gitignore.png 800w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/gitignore-300x251.png 300w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/gitignore-768x642.png 768w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/gitignore-600x502.png 600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>In the example above, we are ignoring the file &#8220;file-to-ignore.docx&#8221; and the folder &#8220;folder-to-ignore.&#8221;<\/p>\n<h4><a id=\"user-content-4-checking-changes\" class=\"anchor\" href=\"https:\/\/github.com\/Lightning-AI\/engineering-class\/blob\/main\/ep06-git-basics\/Ep06-ShowNotes.md#4-checking-changes\" aria-hidden=\"true\"><\/a>4) Checking Changes<\/h4>\n<ul>\n<li><code>git status<\/code>: This shows the changed and tracked files in the current Git repository<\/li>\n<li><code>git log<\/code>: The log command shows the commit history.<\/li>\n<li><code>git diff<\/code>: This command shows the lines that changed since the last commit.<\/li>\n<\/ul>\n<p>Lines that were removed start with a\u00a0<code>-<\/code>\u00a0sign, and lines that were added start with a\u00a0<code>+<\/code> sign. In the example above, the <code>main.py<\/code>\u00a0file was modified, where a line\u00a0<code>some_line = 123<\/code>\u00a0as removed and the line\u00a0<code>new_line = 456<\/code>\u00a0was added.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5646421 size-full\" src=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-diff.png\" alt=\"Git diff\" width=\"1504\" height=\"760\" srcset=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-diff.png 1504w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-diff-300x152.png 300w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-diff-1024x517.png 1024w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-diff-768x388.png 768w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/git-diff-600x303.png 600w\" sizes=\"(max-width: 1504px) 100vw, 1504px\" \/><\/p>\n<h3>Version Control in PyCharm &amp; VSCode<\/h3>\n<p>Note that most IDEs also integrate Git into their UI. In this lecture, we used the Terminal to see how the basic Git commands work step by step. Many people still use Git from the command line while others prefer using Git within PyCharm or VSCode. Using the PyCharm or VSCode UI is totally up to you. However, for now we recommend using Git from the command line to familiarize yourself with the main commands. Later, we can revisit the UI interfaces.<\/p>\n<h3>Further Resources<\/h3>\n<ul>\n<li>We will cover Git in more detail in future episodes, and we recommend to stay tuned! However, if you are curious to explore more on your own, check out\u00a0<span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/git-scm.com\/\" rel=\"nofollow\"><u>this resource<\/u><\/a><\/span>\u00a0for a very detailed Git coverage.<\/li>\n<\/ul>\n<p><strong>Prettier Terminal Layouts<\/strong><\/p>\n<ul>\n<li>For a pretty output formatting where the Git branches are shown in your terminal (similar to the screenshots above), check out the\u00a0<span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/github.com\/ohmyzsh\/ohmyzsh\"><u>Oh My Zsh<\/u><\/a><\/span>\u00a0project.<\/li>\n<li>If you are coding on a Mac and also want to style your macOS terminal in general, also have a look at the different macOS terminal themes\u00a0<span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/github.com\/lysyi3m\/macos-terminal-themes\"><u>here<\/u><\/a><\/span>. (Sebastian is using the &#8220;VS Code Dark Plus&#8221; theme for the screenshots above.)<\/li>\n<\/ul>\n<p>Stay tuned for future episodes of Lightning Bits! Also, If you have questions or suggestions, please don&#8217;t hesitate to reach out to William (<span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/twitter.com\/_willfalcon\" rel=\"nofollow\">@_willfalcon<\/a><\/span>) and Sebastian (<span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/twitter.com\/rasbt\" rel=\"nofollow\">@rasbt<\/a><\/span>) on Twitter or join us on <a style=\"color: #0000ff;\" href=\"https:\/\/pytorch-lightning.slack.com\/archives\/C03GS6MTCCQ\" rel=\"nofollow\"><u>Slack<\/u><\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this Lightning Bits episode, William and Sebastian discuss why version control is useful and important for tracking code changes, and they will show you the fundamental Git workflow and commands. Watch the video, or continue reading below. What is Git? Version control (also known as source control) allows us to track code changes and<a class=\"excerpt-read-more\" href=\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/\" title=\"ReadEP 06: Version Control Using Git\">&#8230; Read more &raquo;<\/a><\/p>\n","protected":false},"author":16,"featured_media":5646422,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[102],"tags":[90,91,77,89],"glossary":[],"acf":{"hide_from_archive":null,"content_type":null,"code_embed":null,"code_shortcode":null,"custom_styles":null,"sticky":null,"additional_authors":null,"mathjax":null,"default_editor":null,"sections":null,"show_table_of_contents":null,"table_of_contents":null,"tabs":null,"tab_group":null},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>EP 06: Version Control Using Git - Lightning AI<\/title>\n<meta name=\"description\" content=\"Learn why version control is useful and important for tracking code changes, and some fundamental Git workflow and commands.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"EP 06: Version Control Using Git - Lightning AI\" \/>\n<meta property=\"og:description\" content=\"Learn why version control is useful and important for tracking code changes, and some fundamental Git workflow and commands.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/\" \/>\n<meta property=\"og:site_name\" content=\"Lightning AI\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-21T13:58:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-10T15:12:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/Version-Control-Using-Git.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=\"JP Hennessy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@LightningAI\" \/>\n<meta name=\"twitter:site\" content=\"@LightningAI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"JP Hennessy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/\"},\"author\":{\"name\":\"JP Hennessy\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/person\/2518f4d5541f8e98016f6289169141a6\"},\"headline\":\"EP 06: Version Control Using Git\",\"datePublished\":\"2022-06-21T13:58:00+00:00\",\"dateModified\":\"2022-09-10T15:12:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/\"},\"wordCount\":929,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#organization\"},\"image\":{\"@id\":\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/Version-Control-Using-Git.png\",\"keywords\":[\"git\",\"github\",\"lightning bits\",\"version control\"],\"articleSection\":[\"Lightning Bits\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/\",\"url\":\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/\",\"name\":\"EP 06: Version Control Using Git - Lightning AI\",\"isPartOf\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/Version-Control-Using-Git.png\",\"datePublished\":\"2022-06-21T13:58:00+00:00\",\"dateModified\":\"2022-09-10T15:12:58+00:00\",\"description\":\"Learn why version control is useful and important for tracking code changes, and some fundamental Git workflow and commands.\",\"breadcrumb\":{\"@id\":\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#primaryimage\",\"url\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/Version-Control-Using-Git.png\",\"contentUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/Version-Control-Using-Git.png\",\"width\":1280,\"height\":720,\"caption\":\"Version Control Using Git\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/lightning.ai\/pages\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"EP 06: Version Control Using Git\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/lightning.ai\/pages\/#website\",\"url\":\"https:\/\/lightning.ai\/pages\/\",\"name\":\"Lightning AI\",\"description\":\"The platform for teams to build AI.\",\"publisher\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/lightning.ai\/pages\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/lightning.ai\/pages\/#organization\",\"name\":\"Lightning AI\",\"url\":\"https:\/\/lightning.ai\/pages\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png\",\"contentUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png\",\"width\":1744,\"height\":856,\"caption\":\"Lightning AI\"},\"image\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/LightningAI\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/person\/2518f4d5541f8e98016f6289169141a6\",\"name\":\"JP Hennessy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/28ade268218ae45f723b0b62499f527a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/28ade268218ae45f723b0b62499f527a?s=96&d=mm&r=g\",\"caption\":\"JP Hennessy\"},\"url\":\"https:\/\/lightning.ai\/pages\/author\/jplightning-ai\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"EP 06: Version Control Using Git - Lightning AI","description":"Learn why version control is useful and important for tracking code changes, and some fundamental Git workflow and commands.","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:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/","og_locale":"en_US","og_type":"article","og_title":"EP 06: Version Control Using Git - Lightning AI","og_description":"Learn why version control is useful and important for tracking code changes, and some fundamental Git workflow and commands.","og_url":"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/","og_site_name":"Lightning AI","article_published_time":"2022-06-21T13:58:00+00:00","article_modified_time":"2022-09-10T15:12:58+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/Version-Control-Using-Git.png","type":"image\/png"}],"author":"JP Hennessy","twitter_card":"summary_large_image","twitter_creator":"@LightningAI","twitter_site":"@LightningAI","twitter_misc":{"Written by":"JP Hennessy","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#article","isPartOf":{"@id":"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/"},"author":{"name":"JP Hennessy","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/person\/2518f4d5541f8e98016f6289169141a6"},"headline":"EP 06: Version Control Using Git","datePublished":"2022-06-21T13:58:00+00:00","dateModified":"2022-09-10T15:12:58+00:00","mainEntityOfPage":{"@id":"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/"},"wordCount":929,"commentCount":0,"publisher":{"@id":"https:\/\/lightning.ai\/pages\/#organization"},"image":{"@id":"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#primaryimage"},"thumbnailUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/Version-Control-Using-Git.png","keywords":["git","github","lightning bits","version control"],"articleSection":["Lightning Bits"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/","url":"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/","name":"EP 06: Version Control Using Git - Lightning AI","isPartOf":{"@id":"https:\/\/lightning.ai\/pages\/#website"},"primaryImageOfPage":{"@id":"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#primaryimage"},"image":{"@id":"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#primaryimage"},"thumbnailUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/Version-Control-Using-Git.png","datePublished":"2022-06-21T13:58:00+00:00","dateModified":"2022-09-10T15:12:58+00:00","description":"Learn why version control is useful and important for tracking code changes, and some fundamental Git workflow and commands.","breadcrumb":{"@id":"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#primaryimage","url":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/Version-Control-Using-Git.png","contentUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/08\/Version-Control-Using-Git.png","width":1280,"height":720,"caption":"Version Control Using Git"},{"@type":"BreadcrumbList","@id":"https:\/\/lightning.ai\/pages\/education\/lightning-bits\/version-control-using-git\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/lightning.ai\/pages\/"},{"@type":"ListItem","position":2,"name":"EP 06: Version Control Using Git"}]},{"@type":"WebSite","@id":"https:\/\/lightning.ai\/pages\/#website","url":"https:\/\/lightning.ai\/pages\/","name":"Lightning AI","description":"The platform for teams to build AI.","publisher":{"@id":"https:\/\/lightning.ai\/pages\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/lightning.ai\/pages\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/lightning.ai\/pages\/#organization","name":"Lightning AI","url":"https:\/\/lightning.ai\/pages\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/","url":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png","contentUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png","width":1744,"height":856,"caption":"Lightning AI"},"image":{"@id":"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/LightningAI"]},{"@type":"Person","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/person\/2518f4d5541f8e98016f6289169141a6","name":"JP Hennessy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/28ade268218ae45f723b0b62499f527a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/28ade268218ae45f723b0b62499f527a?s=96&d=mm&r=g","caption":"JP Hennessy"},"url":"https:\/\/lightning.ai\/pages\/author\/jplightning-ai\/"}]}},"_links":{"self":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/posts\/5646416"}],"collection":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/comments?post=5646416"}],"version-history":[{"count":0,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/posts\/5646416\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/media\/5646422"}],"wp:attachment":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/media?parent=5646416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/categories?post=5646416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/tags?post=5646416"},{"taxonomy":"glossary","embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/glossary?post=5646416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}