{"id":64215,"date":"2020-12-03T11:32:48","date_gmt":"2020-12-03T16:32:48","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/?page_id=64215"},"modified":"2023-09-26T10:52:36","modified_gmt":"2023-09-26T14:52:36","slug":"git","status":"publish","type":"page","link":"https:\/\/www.inmotionhosting.com\/support\/website\/git\/","title":{"rendered":"Git Version Control System"},"content":{"rendered":"<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"538\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git-1024x538.png\" alt=\"Complete Guide to Learn Git in 7 Minutes\" class=\"wp-image-88604\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git-1024x538.png 1024w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git-300x158.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git-768x403.png 768w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git.png 1200w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/figure>\n\n\n\n<p>\nIn this article, and further tutorials in this series, you will learn\nabout the Git version control system and how it is used for managing\nsource code and text files for a wide variety of applications.\n<\/p>\n\n\n\n<p>\nMore than conceptual, this article will provide you with a 1-2-3\n<a href=\"#start\">getting started cheat sheet<\/a> for running with Git right away.\n<\/p>\n\n\n\n<div id=\"text-table-of-contents\">\n<ul>\n<li><a href=\"#orge1c0df7\">What is Git?<\/a><\/li>\n<li><a href=\"#hosting\">Git, Hosted and Self-hosted<\/a>\n<ul>\n<li><a href=\"#org0f12f56\">Free and Open Source<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#orgeee823f\">Where to Start With Git<\/a>\n<ul>\n<li><a href=\"#com-gui\">Command Line or GUI<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#orge1eae57\">The Git Three-tier Architecture<\/a><\/li>\n<li><a href=\"#start\">Git in Practice: A Complete Beginner\u2019s Guide<\/a>\n<ul>\n<li><a href=\"#wd\">The Working Directory<\/a><\/li>\n<li><a href=\"#init\">Initialize Repository<\/a><\/li>\n<li><a href=\"#staging\">The Staging Index<\/a><\/li>\n<li><a href=\"#repo\">The Repository<\/a><\/li>\n<li><a href=\"#branches\">Branches<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n\n\n\n<div id=\"outline-container-orge1c0df7\" class=\"outline-2\">\n<h2 id=\"orge1c0df7\"><a id=\"ID-e3b27095-a451-4155-b32a-761a1145e26f\"><\/a>What is Git?<\/h2>\n<div class=\"outline-text-2\" id=\"text-orge1c0df7\">\n<p>\nGit is an open source cross-platform version control system.  Every\nproject involving various text files will have a <i>revision history<\/i>,\nand Git helps you keep track of it.\n<\/p>\n\n<p>\nYou will often hear that Git is a <b>distributed version control\nsystem<\/b>.  But what does that mean?\n<\/p>\n\n<p>\nThe program provides a suite of commands that help you track changes\nmade to source code over time as well as well as deploy code to local\nand remote repositories.  Git is \u201cdistributed\u201d in the sense that\nthere need not be one central repository for source code, but\nindividual users may \u201cclone\u201d the project into their workstations and\nhave all the content they need to do their job.  When they\u2019re done,\nthey can submit their work to a shared remote repository so other\npeople can see what they did.\n<\/p>\n\n<p>\nIt\u2019s easy to think of Git version control as a journal containing the\ndetailed history of your project.\n<\/p>\n\n<p>\nThose journal entries are kept in the repository.  Once you have added\nfiles to the staging index, you want to let Git know when to record\nthose changes into the journal.  In the Git world, this is called a\n\u201ccommit.\u201d\n<\/p>\n\n<p>\nYou can think of it as making a commitment to record the changes you\nmade in your working directory to the permanently recorded history.\nOnce changes have been committed, they go into the repository.  And\nyou can later revisit any point of history in the repository.  Each\n\u201ccommit\u201d is marked with a unique identifier.  \n<\/p>\n\n<p>\nPlus, Git requires that you provide a \u201ccommit message\u201d providing some\nbackground detail on what this commit consists of.  This way, Git\n<i>forces<\/i> you to keep your project details, upgrades, bug fixes, and\nfeatures very well documented.\n<\/p>\n<\/div>\n<\/div>\n\n\n\n<div id=\"outline-container-org77d0480\" class=\"outline-2\">\n<h2 id=\"hosting\"><a id=\"org77d0480\"><\/a><a id=\"ID-23984df0-b901-4b63-874c-02a6634f9a0a\"><\/a>Git, Hosted and Self-hosted<\/h2>\n<div class=\"outline-text-2\" id=\"text-hosting\">\n<p>\nThere are many popular hosting platforms available for Git, such as\nGithub and Bitbucket.\n<\/p>\n\n<p>\nMany of these platforms offer special features and addons built around\nthe base functionality of Git.\n<\/p>\n<\/div>\n\n<div id=\"outline-container-org0f12f56\" class=\"outline-3\">\n<h3 id=\"org0f12f56\"><a id=\"ID-4b46723e-309e-4475-993e-73ff7ee5212e\"><\/a>Free and Open Source<\/h3>\n<div class=\"outline-text-3\" id=\"text-org0f12f56\">\n<p>\nGit is free and open source software, so you can host your own Git\nserver if you want to.  It also works with just about every operating\nsystem.\n<\/p>\n\n<p>\nSome hosted services offer a self-hosted variant.  GitLab offers\na lot of the features you would see in GitHub but with an optional\nself-hosted package you could install on a private server.\n<\/p>\n\n<p>\nHowever, if you are interested in managing your own Git repositories\non a private server, this is the tutorial series for you.\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div id=\"outline-container-orgeee823f\" class=\"outline-2\">\n<h2 id=\"orgeee823f\"><a id=\"ID-89e4d477-541e-42b8-bae4-85751b0f6cb1\"><\/a>Where to Start With Git<\/h2>\n<div class=\"outline-text-2\" id=\"text-orgeee823f\">\n<p>\nThere is so much you can do with Git version control and file\nmanagement that we have chosen to limit this tutorial to the bare\nessentials.  \n<\/p>\n\n<p>\nThis means even though there is much more information available about\nthis program, you will be up and running quickly with everything you\nneed to get started using Git right away.\n<\/p>\n\n<p>\nWhether you choose to use a third party Git hosting platform in the\nfuture, or if you prefer to manage your own repositories, in this\ntutorial, you will learn how to build and manage your repositories\nfrom the ground up using command line tools you already have available\non your computer.  We are going to learn how to initiate a repository\nand track files, commit changes, tag and sign commits, and how to push\nchanges and deploy files.\n<\/p>\n<\/div>\n\n<div id=\"outline-container-org5d531b0\" class=\"outline-3\">\n<h3 id=\"com-gui\"><a id=\"org5d531b0\"><\/a><a id=\"ID-ba343400-e70e-46b8-a321-6974519f2e5a\"><\/a>Command Line or GUI<\/h3>\n<div class=\"outline-text-3\" id=\"text-com-gui\">\n<p>\nWhen first learning how to use Git, you have a choice between using\nthe command line version and a graphical user interface (GUI) version.\n<\/p>\n\n<p>\nIn this article, we presume you are interesting in learning the\ncommand line variant.  There are certain benefits in using the command\nline version of Git including:\n<\/p>\n\n<ul class=\"org-ul\">\n<li>Wide support across various platforms<\/li>\n<li>Commands stay the same no matter where you are<\/li>\n<li>Allows for scripting and aliasing (to run favorite commands faster)<\/li>\n<li>Helps to solidify the conceptual framework behind Git<\/li>\n<\/ul>\n\n<p>\nBut if for any reason you choose to use a GUI, there are many popular\nopen source option including:\n<\/p>\n\n<ul class=\"org-ul\">\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/www.gitkraken.com\/\">Git Kraken<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/magit.vc\/\">Magit<\/a> (for emacs)<\/li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/gitextensions.github.io\/\">Git Extensions<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/desktop.github.com\/\">GitHub Desktop<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/www.sourcetreeapp.com\/\">Sourcetree<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<div id=\"outline-container-orge1eae57\" class=\"outline-2\">\n<h2 id=\"orge1eae57\"><a id=\"ID-2c22c2de-379c-457a-9469-263896ea8b17\"><\/a>The Git Three-tier Architecture<\/h2>\n<div class=\"outline-text-2\" id=\"text-orge1eae57\">\n<p>\nWhile working with Git you will often hear about the working\ndirectory, the staging index, and the repository.  These concepts are\nimportant to grasp from the very beginning in order to get a proper\nfooting in using Git.\n<\/p>\n\n<p>\nThe working directory is where everything starts. This is where you do\nyour work.  Files that you are working with are located in the working\ndirectory on your computer.  Likewise, other users will have clones of\nthe project in their working directories.\n<\/p>\n\n<p>\nThe staging index is where you add the files you want to track.\nTracking files means that Git is watching them for changes in this\nspecial staging area.  When you add files to the staging index, you\nare telling Git, \u201cPlease include this file in the list of files\nassociated with this project and keep note of all changes made to it.\u201d\n<\/p>\n\n\n<center>\n<figure class=\"wp-block-image size-large\">\n<img decoding=\"async\" src=\"https:\/\/www.inmotionhosting.com\/support\/images\/stories\/git\/git-3tier.png\" alt=\"The git 3-tier structure\" class=\"wp-image-10329\">\n<\/figure>\n<\/center>\n\n\n<p>\nYou should now see the full progression before you: files start in the\nworking directory, they are added to the staging index, and then they\nare committed to the repository.  As you can see above, files can also\nbe \u201cchecked out\u201d from the repository, but this is an advanced topic\nthat will be covered later.\n<\/p>\n<\/div>\n<\/div>\n\n\n\n<div id=\"outline-container-org70ab9b8\" class=\"outline-2\">\n<h2 id=\"start\"><a id=\"org70ab9b8\"><\/a><a id=\"ID-fe926b43-4202-44a2-b682-c99eb29a867b\"><\/a>Git in Practice: A Complete Beginner\u2019s Guide<\/h2>\n<div class=\"outline-text-2\" id=\"text-start\">\n<p>\nThis section will introduce the uninitiated beginner to all the\nimmediate Git fundamentals needed to start work right away.  This is a\ncrash course in Git for beginners.\n<\/p>\n\n<p class=\"alert alert-info\">\n<b>Did you know?<\/b>  You can use your <a href=\"https:\/\/www.inmotionhosting.com\/cloud-vps\">cloud server hosting<\/a> as a private Git server.\n<\/p>\n\n<p>\nBefore getting started, you will just need to <a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/how-to-install-git\/\">install Git<\/a>.  If you\u2019ve\nalready complete the installation then you are ready to begin.\n<\/p>\n<\/div>\n\n<div id=\"outline-container-org656a3f3\" class=\"outline-3\">\n<h3 id=\"wd\"><a id=\"org656a3f3\"><\/a><a id=\"ID-62a37f83-5b19-4a4a-a4fc-3e0c4ad394a1\"><\/a>The Working Directory<\/h3>\n<div class=\"outline-text-3\" id=\"text-wd\">\n<p>\nThe working directory is the main directory for the project files.  As\nyou\u2019re learning more about Git you\u2019ll often hear or read mention of\nthe working directory.  It\u2019s basically <i>the<\/i> directory (or, folder)\nthat contains the files for your project.\n<\/p>\n\n<p>\nThe working directory can be altered by Git.  For example, you could\nload previous versions of the project or integrate others\u2019 code from\nanother branch of the project, and your working directory will change.\nThis means you must be careful not to accidentally overwrite files in\nyour working directory.\n<\/p>\n\n<p>\nIn order to start using your working directory, all you have to do is\ncreate a directory and start adding your files to it.\n<\/p>\n\n<p>\nIn the next section, you will find out how to instruct the Git program\nto start watching this directory for changes.\n<\/p>\n<\/div>\n<\/div>\n\n<div id=\"outline-container-org9f84a05\" class=\"outline-3\">\n<h3 id=\"init\"><a id=\"org9f84a05\"><\/a><a id=\"ID-ae621462-d2dc-4ff6-905a-a2f2bf07afe9\"><\/a>Initialize Repository<\/h3>\n<div class=\"outline-text-3\" id=\"text-init\">\n<p>\nBefore you begin your work you\u2019ll need to \u201cinitialize\u201d Git in your\nworking directory, with this command:\n<\/p>\n\n<pre>git init<\/pre>\n\n<p>\nThis command initializes Git functionality in your working directory.\nBut what does that mean?  Git initialization accomplishes the\nfollowing:\n<\/p>\n\n<ul class=\"org-ul\">\n<li>Sets up a <i>.git<\/i> directory in your working directory\n<ul class=\"org-ul\">\n<li>This \u201chidden\u201d directory keeps track of the files and special\nreference markers needed by the Git program<\/li>\n<li>As you get more advanced in Git, you can use some of the items in\nthis directory to achieve advanced effects, but not yet<\/li>\n<\/ul><\/li>\n<li>Opens up your project for Git tracking<\/li>\n<li>Allows you to start running <i>Git<\/i> commands<\/li>\n<\/ul>\n\n<p>\nUpon initialization, your Git project is officially up and running.\nNow you need to let Git know which files to start tracking.\n<\/p>\n<\/div>\n<\/div>\n\n<div id=\"outline-container-orgc30ec48\" class=\"outline-3\">\n<h3 id=\"staging\"><a id=\"orgc30ec48\"><\/a><a id=\"ID-b5484504-c2c1-427b-83e0-b7b80d67ddae\"><\/a>The Staging Index<\/h3>\n<div class=\"outline-text-3\" id=\"text-staging\">\n<p>\nLike the <a href=\"#wd\">working directory<\/a>, the staging index is a fundamental concept\nin Git that you must learn and commit to memory.\n<\/p>\n\n<p>\nYou can think of the <i>staging index<\/i> as a sort of list that tells Git\nwhich files (or modifications to files) you want to <a href=\"#repo\">commit to the\nrepository<\/a>.\n<\/p>\n\n<p>\nYou use the staging index by invoking the <i>git add<\/i> command, for\nexample:\n<\/p>\n\n<pre class=\"example\">git add &lt;name-of-file&gt;\n<\/pre>\n\n<p>\nOr\u2026\n<\/p>\n\n<pre class=\"example\">git add file1.php\n<\/pre>\n\n<p>\nIn the diagram below, suppose three files have been created in the\nworking directory.  Notice:\n<\/p>\n\n<ol class=\"org-ol\">\n<li>The first file has already been tracked by Git and was modified<\/li>\n<li>The second file is new to Git but was just added, indicating that\nit\u2019s a new file for Git to start tracking<\/li>\n<li>The third file has not been added to the staging index, so Git is\nnot aware of it<\/li>\n<\/ol>\n\n<center>\n<figure class=\"wp-block-image size-large\">\n<img decoding=\"async\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2020\/09\/git-staging.png\" alt=\"The git work tree, from working to staging to committing\" class=\"wp-image-10329\"><\/figure>\n<\/center>\n\n<p>\nThis means that even if a file has been previously added to Git for\ntracking, it must be added to the staging index again every time it is\nmodified, otherwise the changes will not be <a href=\"#repo\">committed to the repository<\/a>.\n<\/p>\n<\/div>\n<\/div>\n\n<div id=\"outline-container-org5cd1280\" class=\"outline-3\">\n<h3 id=\"repo\"><a id=\"org5cd1280\"><\/a><a id=\"ID-2c4f262f-2dcf-469d-8dc0-0994f7271761\"><\/a>The Repository<\/h3>\n<div class=\"outline-text-3\" id=\"text-repo\">\n<p>\nOnce you have added the files, and modifications to files, to the\nstaging index, it\u2019s time to create a <i>commit<\/i> for those changes to add\nthem to the repository.\n<\/p>\n\n<p>\nThe repository is the official, logged, and\u2014sometimes\u2014tagged\ndestination for your project files in one state.\n<\/p>\n\n<p>\nYou can think of the repository as the place where all the records of\nthe various <i>states<\/i> of your project are kept.  Each note, or mark, is\ntermed a \u201ccommit,\u201d because it is basically a commitment to the\npermanent record of the project.  This means if you\u2019re working on\nsomething like a software project, the program should be in a solid\nworking condition or at least a somewhat working state when a commit\nis made.\n<\/p>\n\n<p>\nGit requires that all commits be made with a log entry to briefly\nnotate the nature of the commit.\n<\/p>\n\n<p>\nSome example commit messages might be:\n<\/p>\n\n<ul class=\"org-ul\">\n<li>\u201cFixed bug on login screen\u201d<\/li>\n<li>\u201cUpdated emphasis font\u201d<\/li>\n<li>\u201cAdded phone number entry to form fields\u201d<\/li>\n<\/ul>\n\n<p>\nIn order to start a commit, run this command:\n<\/p>\n\n<pre class=\"example\">git commit\n<\/pre>\n\n<p>\nThis command, as is, will open your default text editor for writing in\nyour commit message.\n<\/p>\n\n<p>\nTo skip over the text editor, use the <i>-m<\/i> option and put your commit\nmessage in quotes, like so:\n<\/p>\n\n<pre class=\"example\">git commit -m \"Fixed bug on login screen\"\n<\/pre>\n\n<p>\nAnd, accomplishing more with one command, you can add the <i>-a<\/i> option\nto simultaneously add all file modifications to staging index before\ncommitting:\n<\/p>\n\n<pre class=\"example\">git commit -am \"Fixed bug on login screen\"\n<\/pre>\n\n<p>\nThe latter command demonstrates how the command line Git variant lets\nyou use various options to chain commands together, thus saving a\nlittle time.\n<\/p>\n<\/div>\n<\/div>\n\n<div id=\"outline-container-org6484f58\" class=\"outline-3\">\n<h3 id=\"branches\"><a id=\"org6484f58\"><\/a><a id=\"ID-dea12ceb-baf0-46a7-9029-789e86968fb8\"><\/a>Branches<\/h3>\n<div class=\"outline-text-3\" id=\"text-branches\">\n<p>\nFinally, as you are now ready to embark on your journey in discovering\nthe magic of Git, you need to learn about how branches work.\n<\/p>\n\n<p>\nBranches allow for unlimited iteration of your project files.  For\nexample, if you want to test a new feature or bit of code, you can\ncreate a separate \u201cbranch\u201d of the project.\n<\/p>\n\n<p>\nBy default, every Git project has a master branch, or \u201cupstream\u201d\nbranch that is meant to reference the final\/complete version of your\nproject.\n<\/p>\n\n<p>\nBy creating branches you can make unlimited changes to your project,\nand commit them, without affecting the master copy.\n<\/p>\n\n<p>\nWhen working with branches you can always switch back to the master\nbranch\u2014or other branches to \u201ccheckout\u201d the files or modifications in\nthat branch.\n<\/p>\n\n<p>\nHowever, one caveat of branches is that you can only \u201ccheckout\u201d other\nbranches from a <i>clean state<\/i>.  Which means if you have uncommitted\nchanges in your current branch you cannot checkout other branches.\nBut if you\u2019re unready to commit those changes on your current branch,\nyou can stash them aside for later.\n<\/p>\n\n<p>\nIn order to see what branch you\u2019re currently on, you can run the <i>git\nbranch<\/i> command by itself:\n<\/p>\n\n<pre class=\"example\">git branch\n<\/pre>\n\n<p>\nIf you haven\u2019t created any alternative branches yet, you will see a\nlisting for the \u201cmaster\u201d branch, which you\u2019re on by default.\n<\/p>\n\n<p>\nTo create a new branch you can run <i>git branch<\/i> followed by the name\nof the branch you want to create, like so:\n<\/p>\n\n<pre class=\"example\">git branch &lt;name-of-branch&gt;\n<\/pre>\n\n<p>\nNow when you run <i>git branch<\/i> you\u2019ll see \u201cmaster\u201d and the new branch\nlisted.  Master will still be selected as your active branch.\n<\/p>\n\n<p>\nIn order to \u201ccheckout\u201d a different branch, run the <i>git checkout<\/i>\ncommand followed by the name of the branch you want to check out.\n<\/p>\n\n<pre class=\"example\">git checkout &lt;name-of-branch&gt;\n<\/pre>\n\n<p>\nYou can check to make sure you\u2019re on the new branch by running <i>git\nbranch<\/i> again to see that the new branch is selected\/highlighted.\n(It\u2019s always good to check your work.)\n<\/p>\n\n<p>\nNow, notice, if you make changes to the files on this branch, you will\nnot be able to switch back over to the \u201cmaster\u201d branch unless you\ncommit your changes or stash them.\n<\/p>\n\n<p>\nTo stash your changes, run <i>git stash<\/i>.\n<\/p>\n\n<pre class=\"example\">git stash\n<\/pre>\n\n<p>\nWhen you return to the new branch, you can unstash, or \u201cpop,\u201d your\nchanges.  (Actually, you can pop changes on any branch.  See the full\nguide on <a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/stash\/\">git stash<\/a> to learn more.)\n<\/p>\n\n<hr>\n\n<p>\nThose are the very basics of Git.  From there, you can master the\nentire program because you have grounded yourself in the fundamentals.\nIf you have any issues, or unexpected errors, leave a comment below\nand the InMotion community team will try to help out.\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<p><strong>Explore more Git-related content here:<\/strong><\/p>\n\n\n<ul class=\"lcp_catlist\" id=\"lcp_instance_0\"><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/publish-lovable-webapp-to-ultrastack-one-for-react\/\">How to Publish Your Lovable Created React WebApp to UltraStack ONE for React<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/publish-lovable-webapp-via-github\/\">Publish Your Lovable Created React WebApp to InMotion Hosting Shared Hosting via GitHub<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/understanding-git-objects\/\">Understanding Git Objects<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/view-projects-in-gitweb\/\">How To View Projects in GitWeb<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-checkout\/\">Git Checkout Command &#8211; How To Switch To Branches and Commits<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-clean\/\">Using Git Clean To Remove Unwanted Files<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/gitignore\/\">Using &#8220;Gitignore&#8221; To Make Files Invisible to Git<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/change-commit-message\/\">Change Commit Message In Git<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-aliases\/\">Speed Up Your Workflow With Git Aliases<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-notes\/\">How to Create and View Git Notes<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-switch\/\">Git Switch For Faster Branch Management<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-for-bash\/\">Enhance Your Shell With Git For Bash<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/push-branch-remote\/\">Push Branch To Remote Server With Git<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/change-branch-name\/\">How To Change Branch Name in Git<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/delete-branch\/\">How To Delete a Branch in Git<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/does-not-appear-to-be-a-git-repository\/\">Git Error: &#8220;Does Not Appear To Be a Git Repository&#8221;<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/merge-conflict\/\">Merge Conflict In Git &#8211; And How To Fix It<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/how-to-go-to-master-branch-in-git\/\">How To Go To Master Branch in Git<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-basics\/\">What Are The Basics of Git I Should Know?<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-undo-commit\/\">Can You Undo a Commit In Git?<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-clone\/\">Git Clone Quick Start Guide<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-tags\/\">How to Use Git Tags<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-hooks\/\">Git Hooks (and How They Work)<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-config\/\">Git Config Recommended Settings<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-rebase\/\">Git Rebase and How It Works<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/gitweb-on-nginx\/\">How To Install and Serve Gitweb on NGINX in Debian<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-server\/\">How to Create Your Own Git Server<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/deploy-files-github-actions\/\">Deploy Files With GitHub Actions for FTP and SCP<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/git-fundamentals-complete-beginner-guide\/\">Git Fundamentals Complete Beginner Guide<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/stash-apply\/\">How to Git Stash &#8220;Apply&#8221; to Preserve Stash<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/stash\/\">How to Git Stash<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/how-to-remove-or-unstage-files-from-your-git-staging-index\/\">How To Remove Or Unstage Files From Your Git Staging Index<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/how-to-install-git\/\">How to Install Git<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/how-to-create-a-git-repository-on-your-reseller-vps\/\">How to Create a Git Repository on Your Reseller VPS<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/host-site-github-pages\/\">How to Host a Static Site with GitHub Pages<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/using-your-github-account\/\">Using Your GitHub Account<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/connect-local-project-to-github\/\">Connect Local Project to a Github Repository<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/create-repository-github\/\">How to Create a Repository on GitHub<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/why-of-why-not-use-github\/\">Why or Why Not Use Github?<\/a><\/li><li><a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/using-git-to-publish-files\/\">Using Git to Publish Files<\/a><\/li><\/ul><ul class='lcp_paginator'><li class='lcp_currentpage'>1<\/li><li><a href='https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/pages\/64215?lcp_page0=2#lcp_instance_0' title='2'>2<\/a><\/li><li><a href='https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/pages\/64215?lcp_page0=2#lcp_instance_0' title='2' class='lcp_nextlink'>&gt;&gt;<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In this article, and further tutorials in this series, you will learn about the Git version control system and how it is used for managing source code and text files for a wide variety of applications. More than conceptual, this article will provide you with a 1-2-3 getting started cheat sheet for running with Git<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/\"> Read More ><\/a><\/p>\n","protected":false},"author":17,"featured_media":0,"parent":78339,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-64215","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Guide to Git Version Control System | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Git is a free and open source version control system for anyone who manages files for both simple and complicated projects.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Guide to Git Version Control System | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Git is a free and open source version control system for anyone who manages files for both simple and complicated projects.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-26T14:52:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git.png\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/\",\"name\":\"Guide to Git Version Control System | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git-1024x538.png\",\"datePublished\":\"2020-12-03T16:32:48+00:00\",\"dateModified\":\"2023-09-26T14:52:36+00:00\",\"description\":\"Git is a free and open source version control system for anyone who manages files for both simple and complicated projects.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/#primaryimage\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git.png\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git.png\",\"width\":1200,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/git\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Website\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/website\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Git Version Control System\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Guide to Git Version Control System | InMotion Hosting","description":"Git is a free and open source version control system for anyone who manages files for both simple and complicated projects.","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:\/\/www.inmotionhosting.com\/support\/website\/git\/","og_locale":"en_US","og_type":"article","og_title":"Guide to Git Version Control System | InMotion Hosting","og_description":"Git is a free and open source version control system for anyone who manages files for both simple and complicated projects.","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/git\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_modified_time":"2023-09-26T14:52:36+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_image":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git.png","twitter_site":"@InMotionHosting","twitter_misc":{"Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/git\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/git\/","name":"Guide to Git Version Control System | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/git\/#primaryimage"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/git\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git-1024x538.png","datePublished":"2020-12-03T16:32:48+00:00","dateModified":"2023-09-26T14:52:36+00:00","description":"Git is a free and open source version control system for anyone who manages files for both simple and complicated projects.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/git\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/git\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/git\/#primaryimage","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git.png","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/09\/What-Is-Git.png","width":1200,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/git\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Website","item":"https:\/\/www.inmotionhosting.com\/support\/website\/"},{"@type":"ListItem","position":3,"name":"Git Version Control System"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]}]}},"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/pages\/64215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=64215"}],"version-history":[{"count":9,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/pages\/64215\/revisions"}],"predecessor-version":[{"id":106922,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/pages\/64215\/revisions\/106922"}],"up":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/pages\/78339"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=64215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}