{"id":28371,"date":"2023-04-23T05:48:48","date_gmt":"2023-04-23T05:48:48","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=28371"},"modified":"2023-04-23T05:49:07","modified_gmt":"2023-04-23T05:49:07","slug":"what-is-git-and-how-it-works-an-overview-and-its-use-cases","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/what-is-git-and-how-it-works-an-overview-and-its-use-cases\/","title":{"rendered":"What is Git and How it works? An Overview and Its Use Cases?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">What is Git?<\/h2>\n\n\n\n<p>Git is a free and open-source distributed versions control system use to handle small to very laravel projects code enabling multiple developers to work together.  Git additionally makes cooperation simpler, permitting changes by numerous individuals to be generally converged into one source. Git is generally utilized for both open source and business programming improvement, with huge advantages for people, groups and organizations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">History &amp; Origin of GIT<\/h2>\n\n\n\n<p>History. Git development began in April 2005, after many developers of the Linux kernel gave up access to BitKeeper, a proprietary source-control management (SCM) system that they had been using to maintain the project since 2002.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How Git works<\/strong>?<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Initialize a Git repository: You can initialize a Git repository in a directory by running the <code>git init<\/code> command. This creates a hidden <code>.git<\/code> directory in your project folder, which contains all the metadata that Git uses to keep track of your files.<\/li>\n\n\n\n<li>Track files: Once you have a Git repository, you can start tracking files by adding them to the staging area with the <code>git add<\/code> command. This tells Git to start tracking changes to those files.<\/li>\n\n\n\n<li>Make changes: You can modify files in your project folder as you normally would. Git will keep track of any changes you make.<\/li>\n\n\n\n<li>Stage changes: When you&#8217;re ready to commit changes to the repository, you can stage them by running the <code>git add<\/code> command again. This tells Git to prepare those changes for commit.<\/li>\n\n\n\n<li>Commit changes: To actually save your changes to the repository, you can run the <code>git commit<\/code> command. This creates a new commit in the repository with the changes you&#8217;ve staged.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Git Architecture and Workflow?<\/h2>\n\n\n\n<p>In Git, there are three main areas where changes to files can be tracked: the workspace, the staging area, and the repository.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Workspace:<\/strong> The workspace is where you edit your files. It&#8217;s simply the directory on your local machine where your project files are stored. Any changes you make to your files in the workspace are not tracked by Git until you add them to the staging area.<\/li>\n\n\n\n<li><strong>Staging area:<\/strong> The staging area, also known as the index, is a temporary storage area where Git tracks changes to files that are ready to be committed. When you use the <code>git add<\/code> command, Git adds the changes you&#8217;ve made in the workspace to the staging area. Once you&#8217;ve added all the changes you want to commit, you can then use the <code>git commit<\/code> command to permanently save those changes to the repository.<\/li>\n\n\n\n<li><strong>Repository:<\/strong> The repository is where Git permanently stores your project files and their complete history. When you commit changes in Git, a new snapshot of your project files is created and stored in the repository. This snapshot includes all the changes that were added to the staging area. You can use the <code>git log<\/code> command to view the commit history of the repository, which shows all the changes that have been made to the files in the repository over time.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"495\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/image-116.png\" alt=\"\" class=\"wp-image-33527\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/image-116.png 660w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/image-116-300x225.png 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><br><\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/bytesofgigabytes.com\/IMAGES\/git\/git%20commands\/git%20commands.png\" alt=\"Git commands \u2013 BytesofGigabytes\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"301\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/image-115-1024x301.png\" alt=\"\" class=\"wp-image-33524\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/image-115-1024x301.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/image-115-300x88.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/image-115-768x226.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/image-115-1536x452.png 1536w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/image-115.png 1869w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"328\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/git-workflow-doc-1-1024x328.jpg\" alt=\"\" class=\"wp-image-33525\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/git-workflow-doc-1-1024x328.jpg 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/git-workflow-doc-1-300x96.jpg 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/git-workflow-doc-1-768x246.jpg 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/git-workflow-doc-1-1536x492.jpg 1536w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2023\/04\/git-workflow-doc-1.jpg 1549w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Use case of Git<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Tracks history<\/li>\n\n\n\n<li>Free and open source<\/li>\n\n\n\n<li>Supports non-linear development<\/li>\n\n\n\n<li>Creates backups<\/li>\n\n\n\n<li>Scalable<\/li>\n\n\n\n<li>Supports collaboration<\/li>\n\n\n\n<li>Branching is easier<\/li>\n\n\n\n<li>Distributed development<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Feature and Advantage of using GIT<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Tracks history.<\/li>\n\n\n\n<li>Free and open source.<\/li>\n\n\n\n<li>Supports non-linear development.<\/li>\n\n\n\n<li>Creates backups.<\/li>\n\n\n\n<li>Scalable.<\/li>\n\n\n\n<li>Supports collaboration.<\/li>\n\n\n\n<li>Branching is easier.<\/li>\n\n\n\n<li>Distributed development.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Best Alternative of GIT<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Azure DevOps Server.<\/li>\n\n\n\n<li>Helix Core.<\/li>\n\n\n\n<li>AWS CodeCommit.<\/li>\n\n\n\n<li>Subversion.<\/li>\n\n\n\n<li>Rational ClearCase.<\/li>\n\n\n\n<li>Mercurial.<\/li>\n\n\n\n<li>Micro Focus AccuRev.<\/li>\n\n\n\n<li>CVS.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Best Resources, Tutorials and Guide for GIT<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.devopsschool.com\/\"><strong>DevOpsSchool<\/strong><\/a><\/li>\n\n\n\n<li>Udemy<\/li>\n\n\n\n<li>learngitbranching<\/li>\n\n\n\n<li>pluralsight<\/li>\n\n\n\n<li>codecademy<\/li>\n\n\n\n<li>educative<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Interview Questions and Answer for GIT<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>What is the use of the git config command?<br><\/strong><br>The git config command is used to set git configuration values on a global or local system. It alters the configuration options in your git installation. It is generally used to set your Git email, editor, and any aliases you want to use with the git command.<\/li>\n<\/ol>\n\n\n\n<p><strong>2. What is a git repository?<\/strong><\/p>\n\n\n\n<p>A repository is a file structure where git stores all the project-based files. Git can either stores the files on the local or the remote repository.<\/p>\n\n\n\n<p><strong>3. What is \u2018git add\u2019 is used for?<\/strong><\/p>\n\n\n\n<p>\u2018git add\u2019 adds file changes in your existing directory to your index.<\/p>\n\n\n\n<p><strong>4<\/strong>. <strong>What is git Is-tree?<\/strong><\/p>\n\n\n\n<p>\u2018git Is-tree\u2019 represents a tree object including the mode and the name of each item and the SHA-1 value of the blob or the tree.<\/p>\n\n\n\n<p><strong>5. What is the use of \u2018git log\u2019?<\/strong><\/p>\n\n\n\n<p>To find specific commits in your project history- by author, date, content or history \u2018git log\u2019 is used.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Jobs &amp; Salary Prospectus of GIT skills<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"889\" height=\"468\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/03\/image-5.png\" alt=\"\" class=\"wp-image-28375\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/03\/image-5.png 889w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/03\/image-5-300x158.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/03\/image-5-768x404.png 768w\" sizes=\"auto, (max-width: 889px) 100vw, 889px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Best Certifications in<\/strong> <strong>GIT<\/strong><\/h2>\n\n\n\n<p>freecodecamp<br><strong><a href=\"https:\/\/www.scmgalaxy.com\/\" target=\"_blank\" rel=\"noopener\">ScmGalaxy<\/a><\/strong><br><strong><a href=\"https:\/\/www.scmgalaxy.com\/\" target=\"_blank\" rel=\"noopener\">DevOpsSchool<\/a><br><\/strong>mygreatlearning<br>intellipaat<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Free Video Tutorials of GIT<\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-embed-handler wp-block-embed-embed-handler wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Git and GitHub for Beginners - Crash Course\" width=\"720\" height=\"405\" src=\"https:\/\/www.youtube.com\/embed\/RGOj5yH7evk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>What is Git? Git is a free and open-source distributed versions control system use to handle small to very laravel projects code enabling multiple developers to work together. Git additionally makes cooperation simpler, permitting changes by numerous individuals to be generally converged into one source. Git is generally utilized for both open source and business&#8230;<\/p>\n","protected":false},"author":1,"featured_media":28379,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[38],"tags":[160,6245,5020,771,405],"class_list":["post-28371","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-git","tag-git","tag-git-bash","tag-git-commit","tag-git-interview","tag-github"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/28371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=28371"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/28371\/revisions"}],"predecessor-version":[{"id":33529,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/28371\/revisions\/33529"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/28379"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=28371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=28371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=28371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}