{"id":8736,"date":"2025-03-24T19:44:54","date_gmt":"2025-03-24T14:14:54","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=8736"},"modified":"2025-03-24T19:44:59","modified_gmt":"2025-03-24T14:14:59","slug":"git-fundamentals","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/git-fundamentals\/","title":{"rendered":"Git Fundamentals"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">Git<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. <strong>What is Git?<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Git is a distributed version control system for tracking changes in code, enabling collaboration, and managing project history.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Every user has a full local copy of the repository.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">2. <strong>Key Concepts<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Repository (Repo):<\/strong> Where your project files and history live (local or remote).<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Commit:<\/strong> A snapshot of changes with a unique hash.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Branch:<\/strong> A separate line of development (default is often <code>main<\/code>).<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Merge:<\/strong> Combines changes from one branch into another.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Rebase:<\/strong> Moves or &#8220;replays&#8221; commits from one branch onto another, creating a linear history.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Staging Area:<\/strong> Prepares changes for a commit.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Clone:<\/strong> Copies a remote repo locally.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Push\/Pull:<\/strong> Syncs changes with a remote repo.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">3. <strong>Basic Git Workflow<\/strong><\/h4>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>git init: Starts a new repo.\n\ngit status: Checks the current state.\n\ngit add &lt;file&gt; or git add .: Stages changes.\n\ngit commit -m \"message\": Commits staged changes.\n\ngit push  :Syncs changes with a remote repo.\n\ngit log: Views commit history.<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">4. <strong>Branching and Merging<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>Create Branch: git branch &lt;branch-name&gt;\n\nSwitch Branch: git checkout &lt;branch-name&gt; (or git switch &lt;branch-name&gt;)\n\nMerge: git merge &lt;branch-name&gt;\n\nDelete Branch: git branch -d &lt;branch-name&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">5. <strong>Rebasing<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>What is Rebasing?<\/strong> Rebasing rewrites commit history by moving your branch\u2019s commits onto the tip of another branch. It avoids merge commits for a cleaner history.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Command:<\/strong> <code>git rebase &lt;branch-name&gt;<\/code> (e.g., <code>git rebase main<\/code> applies your current branch\u2019s commits on top of <code>main<\/code>).<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Interactive Rebasing:<\/strong> <code>git rebase -i &lt;commit-hash&gt;<\/code> lets you edit, squash, or reorder commits.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Resolve Conflicts:<\/strong> If conflicts arise, fix them, then <code>git rebase --continue<\/code>.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">6. <strong>Remote Repositories<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone &lt;url&gt;: Copies a remote repo.\n\ngit remote add origin &lt;url&gt;: Links to a remote.\n\ngit push origin &lt;branch-name&gt;: Uploads changes.\n\ngit pull origin &lt;branch-name&gt;: Downloads updates.<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">7. <strong>Undoing Changes<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>git restore &lt;file&gt;: Discards unstaged changes.\n\ngit reset --soft HEAD^: Undoes last commit, keeps changes.\n\ngit revert &lt;commit-hash&gt;: Creates a new commit undoing a previous one.<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">8. <strong>Common Commands<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>git diff: Shows changes.\n\ngit fetch: Downloads remote updates without merging.\n\ngit stash: Shelves uncommitted changes.<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><\/h3>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Git 1. What is Git? 2. Key Concepts 3. Basic Git Workflow 4. Branching and Merging 5. Rebasing 6. Remote Repositories 7. Undoing Changes 8. Common Commands<\/p>\n","protected":false},"author":514,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":{"0":"post-8736","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-uncategorized","7":"h-entry","9":"h-as-article"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Pheonix Solutions - We Empower Your Business Growth<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/pheonixsolutions.com\/blog\/git-fundamentals\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pheonix Solutions - We Empower Your Business Growth\" \/>\n<meta property=\"og:description\" content=\"Git 1. What is Git? 2. Key Concepts 3. Basic Git Workflow 4. Branching and Merging 5. Rebasing 6. Remote Repositories 7. Undoing Changes 8. Common Commands\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pheonixsolutions.com\/blog\/git-fundamentals\/\" \/>\n<meta property=\"og:site_name\" content=\"PHEONIXSOLUTIONS\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-24T14:14:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-24T14:14:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/PX2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"3837\" \/>\n\t<meta property=\"og:image:height\" content=\"2540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"sujith k\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pheonixsolution\" \/>\n<meta name=\"twitter:site\" content=\"@pheonixsolution\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"sujith k\" \/>\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\":\"Article\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/git-fundamentals\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/git-fundamentals\\\/\"},\"author\":{\"name\":\"sujith k\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/9dae21345bec4359dc69cdb1706b96ea\"},\"headline\":\"Git Fundamentals\",\"datePublished\":\"2025-03-24T14:14:54+00:00\",\"dateModified\":\"2025-03-24T14:14:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/git-fundamentals\\\/\"},\"wordCount\":178,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/git-fundamentals\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/git-fundamentals\\\/\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/git-fundamentals\\\/\",\"name\":\"Pheonix Solutions - We Empower Your Business Growth\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2025-03-24T14:14:54+00:00\",\"dateModified\":\"2025-03-24T14:14:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/git-fundamentals\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/git-fundamentals\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/git-fundamentals\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Git Fundamentals\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\",\"name\":\"Pheonix Solutions\",\"description\":\"We Empower Your Business Growth\",\"publisher\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\",\"name\":\"PheonixSolutions\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/12\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/12\\\/logo.png\",\"width\":454,\"height\":300,\"caption\":\"PheonixSolutions\"},\"image\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/PheonixSolutions-209942982759387\\\/\",\"https:\\\/\\\/x.com\\\/pheonixsolution\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/9dae21345bec4359dc69cdb1706b96ea\",\"name\":\"sujith k\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/41c5d1c0dfe05033e1ef6be41e96d1e926b8a6065292fb95c1862a0ffca3ad20?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/41c5d1c0dfe05033e1ef6be41e96d1e926b8a6065292fb95c1862a0ffca3ad20?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/41c5d1c0dfe05033e1ef6be41e96d1e926b8a6065292fb95c1862a0ffca3ad20?s=96&r=g\",\"caption\":\"sujith k\"},\"sameAs\":[\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/wp-admin\"],\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/author\\\/sujith\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pheonix Solutions - We Empower Your Business Growth","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:\/\/pheonixsolutions.com\/blog\/git-fundamentals\/","og_locale":"en_US","og_type":"article","og_title":"Pheonix Solutions - We Empower Your Business Growth","og_description":"Git 1. What is Git? 2. Key Concepts 3. Basic Git Workflow 4. Branching and Merging 5. Rebasing 6. Remote Repositories 7. Undoing Changes 8. Common Commands","og_url":"https:\/\/pheonixsolutions.com\/blog\/git-fundamentals\/","og_site_name":"PHEONIXSOLUTIONS","article_publisher":"https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/","article_published_time":"2025-03-24T14:14:54+00:00","article_modified_time":"2025-03-24T14:14:59+00:00","og_image":[{"width":3837,"height":2540,"url":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/PX2.png","type":"image\/png"}],"author":"sujith k","twitter_card":"summary_large_image","twitter_creator":"@pheonixsolution","twitter_site":"@pheonixsolution","twitter_misc":{"Written by":"sujith k","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pheonixsolutions.com\/blog\/git-fundamentals\/#article","isPartOf":{"@id":"https:\/\/pheonixsolutions.com\/blog\/git-fundamentals\/"},"author":{"name":"sujith k","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/person\/9dae21345bec4359dc69cdb1706b96ea"},"headline":"Git Fundamentals","datePublished":"2025-03-24T14:14:54+00:00","dateModified":"2025-03-24T14:14:59+00:00","mainEntityOfPage":{"@id":"https:\/\/pheonixsolutions.com\/blog\/git-fundamentals\/"},"wordCount":178,"commentCount":0,"publisher":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/pheonixsolutions.com\/blog\/git-fundamentals\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/pheonixsolutions.com\/blog\/git-fundamentals\/","url":"https:\/\/pheonixsolutions.com\/blog\/git-fundamentals\/","name":"Pheonix Solutions - We Empower Your Business Growth","isPartOf":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#website"},"datePublished":"2025-03-24T14:14:54+00:00","dateModified":"2025-03-24T14:14:59+00:00","breadcrumb":{"@id":"https:\/\/pheonixsolutions.com\/blog\/git-fundamentals\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pheonixsolutions.com\/blog\/git-fundamentals\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/pheonixsolutions.com\/blog\/git-fundamentals\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/pheonixsolutions.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Git Fundamentals"}]},{"@type":"WebSite","@id":"https:\/\/pheonixsolutions.com\/blog\/#website","url":"https:\/\/pheonixsolutions.com\/blog\/","name":"Pheonix Solutions","description":"We Empower Your Business Growth","publisher":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pheonixsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/pheonixsolutions.com\/blog\/#organization","name":"PheonixSolutions","url":"https:\/\/pheonixsolutions.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/12\/logo.png","contentUrl":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/12\/logo.png","width":454,"height":300,"caption":"PheonixSolutions"},"image":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/","https:\/\/x.com\/pheonixsolution"]},{"@type":"Person","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/person\/9dae21345bec4359dc69cdb1706b96ea","name":"sujith k","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/41c5d1c0dfe05033e1ef6be41e96d1e926b8a6065292fb95c1862a0ffca3ad20?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/41c5d1c0dfe05033e1ef6be41e96d1e926b8a6065292fb95c1862a0ffca3ad20?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/41c5d1c0dfe05033e1ef6be41e96d1e926b8a6065292fb95c1862a0ffca3ad20?s=96&r=g","caption":"sujith k"},"sameAs":["https:\/\/pheonixsolutions.com\/blog\/wp-admin"],"url":"https:\/\/pheonixsolutions.com\/blog\/author\/sujith\/"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7F4uM-2gU","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/514"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=8736"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8736\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=8736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=8736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=8736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}