<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Narsi Bhati</title>
    <description>The latest articles on DEV Community by Narsi Bhati (@narsi_bhati_b5a2f7480ea1a).</description>
    <link>https://dev.to/narsi_bhati_b5a2f7480ea1a</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2722257%2F1b79228b-6e5a-48f0-9b78-39bb8d19d89a.webp</url>
      <title>DEV Community: Narsi Bhati</title>
      <link>https://dev.to/narsi_bhati_b5a2f7480ea1a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/narsi_bhati_b5a2f7480ea1a"/>
    <language>en</language>
    <item>
      <title>Installation and Setup Git</title>
      <dc:creator>Narsi Bhati</dc:creator>
      <pubDate>Thu, 16 Jan 2025 09:30:04 +0000</pubDate>
      <link>https://dev.to/narsi_bhati_b5a2f7480ea1a/installation-and-setup-git-4p0b</link>
      <guid>https://dev.to/narsi_bhati_b5a2f7480ea1a/installation-and-setup-git-4p0b</guid>
      <description>&lt;h2&gt;
  
  
  Welcome to the Git Course.
&lt;/h2&gt;

&lt;p&gt;Thank you for choosing to learn Git with me. This course provides a solid foundation in version control, helping you manage your projects efficiently. If you find this course helpful, please leave a ⭐️ on my &lt;a href="https://github.com/NarsiBhati-Dev/master-git" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftu6v9kj9xy8lhnjh1txw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftu6v9kj9xy8lhnjh1txw.png" alt="banner" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Git
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Git&lt;/strong&gt; is a free, open-source distributed version control system designed to handle projects of all sizes quickly and efficiently. It helps developers track changes in their code, collaborate with others, and manage different versions of a project over time.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Key Features of Git:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Version Control:&lt;/strong&gt; Tracks changes to files, allowing you to revert to earlier versions if needed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Distributed System:&lt;/strong&gt; Every developer has a complete copy of the repository, enabling offline work and better data security.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Branching and Merging:&lt;/strong&gt; Supports parallel development by letting you create separate branches for features or fixes, then merge them back into the main codebase.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Collaboration:&lt;/strong&gt; Git enables teams to work together efficiently by managing code contributions and resolving conflicts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Speed and Efficiency:&lt;/strong&gt; Optimized for performance, even with large projects.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Installation and Setup Github :
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffrvnav46xzgd45rx6y4g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffrvnav46xzgd45rx6y4g.png" alt="banner" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Windows / Linux (Ubuntu)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;git-all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  MacOS
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installation, you can check if Git is installed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp1wtxgoc8of8n9aoueez.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp1wtxgoc8of8n9aoueez.png" alt="banner" width="800" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Official Manual of Git
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; man git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Navigation Shortcuts:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;• &lt;code&gt;q&lt;/code&gt; : Quit the manual and return to the terminal.&lt;/p&gt;

&lt;p&gt;• &lt;code&gt;j&lt;/code&gt; : Move one line down.&lt;/p&gt;

&lt;p&gt;• &lt;code&gt;k&lt;/code&gt; : Move one line up.&lt;/p&gt;

&lt;p&gt;• &lt;code&gt;d&lt;/code&gt; : Scroll half a page down.&lt;/p&gt;

&lt;p&gt;• &lt;code&gt;u&lt;/code&gt; : Scroll half a page up.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Search Shortcuts:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;• &lt;code&gt;/&amp;lt;term&amp;gt;&lt;/code&gt; : Search for a specific term in the manual.&lt;/p&gt;

&lt;p&gt;• &lt;code&gt;n&lt;/code&gt; : Go to the next occurrence of the search term.&lt;/p&gt;

&lt;p&gt;• &lt;code&gt;N&lt;/code&gt; : Go to the previous occurrence of the search term.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2fvlui6jy29ocdm7nxwf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2fvlui6jy29ocdm7nxwf.png" alt="banner" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Steps for Quick Git Configuration&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Check Current Configurations&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Run these commands to check if your Git identity is already set:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--get&lt;/span&gt; user.name
git config &lt;span class="nt"&gt;--get&lt;/span&gt; user.email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;2. Set Your Identity&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  If the values aren’t set, use the following commands to add them globally (replace with your details):
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--add&lt;/span&gt; &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"github_username_here"&lt;/span&gt;

git config &lt;span class="nt"&gt;--add&lt;/span&gt; &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;3. Set a Default Branch&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Configure Git to use &amp;lt;branch&amp;gt; as the default branch for new repositories:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; init.defaultBranch &amp;lt;branch&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Verify Your Configuration&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  To ensure your settings were saved, check the contents of your global configuration file:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &lt;span class="nb"&gt;cat&lt;/span&gt; ~/.gitconfig
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example Output (~/.gitconfig):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;user]

    name &lt;span class="o"&gt;=&lt;/span&gt; github_username_here

    email &lt;span class="o"&gt;=&lt;/span&gt; email@example.com

&lt;span class="o"&gt;[&lt;/span&gt;init]

    defaultBranch &lt;span class="o"&gt;=&lt;/span&gt; master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
