<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Git and Github]]></title><description><![CDATA[Git and Github]]></description><link>https://anket01.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 13:08:57 GMT</lastBuildDate><atom:link href="https://anket01.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Onboarding Document: Introduction to Git and GitHub]]></title><description><![CDATA[Company:- ChaiCohort]]></description><link>https://anket01.hashnode.dev/onboarding-document-introduction-to-git-and-github</link><guid isPermaLink="true">https://anket01.hashnode.dev/onboarding-document-introduction-to-git-and-github</guid><category><![CDATA[coding]]></category><category><![CDATA[General Programming]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><category><![CDATA[Linux]]></category><category><![CDATA[software development]]></category><dc:creator><![CDATA[Sanket Singh]]></dc:creator><pubDate>Sat, 11 Jan 2025 12:31:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/EUzk9BIEq6M/upload/b4eb91783145f3e1eeb942f76cdcc639.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-what-is-git-amp-github"><strong>What is Git &amp; Github?</strong></h1>
<p>Have you ever gone through your browser history? Well, probably everybody would have gone through it. You would have noticed that it shows the following things —&gt;</p>
<ol>
<li><p>What you searched</p>
</li>
<li><p>When you searched (<em>Both Date &amp; Time)</em></p>
</li>
</ol>
<p>Similarly, Git is a tool that you can use to record the history of your code! It lets you record the following things —&gt;</p>
<ol>
<li><p>What things you added to the code.</p>
</li>
<li><p>What things you removed from the code.</p>
</li>
<li><p>When did you make those changes.</p>
</li>
</ol>
<p>Just like you can remove an entry in your browser history, you can also reverse the changes that you make to your code. (This is the superpower of Git)</p>
<p><strong>In formal sense, Git is a VCS (version control system) designed to track changes in source code and collaborate efficiently with others. It is widely used for software development due to its speed, flexibility, and support for non-linear workflows (e.g., branching and merging ). Github Is a platform that hosts your repositories and make collaboration easy. Together, they make teams to mage code base and track changes.</strong></p>
<h2 id="heading-what-is-version-control"><strong>What is Version Control?</strong></h2>
<p>You would have seen different version of a software <em>(iOS 18.1, iOS 18.1.1).</em> This changing or upgrading of software is nothing but basically few or several changes in the codebase itself. Managing this change in codebase or recording a history of this change (This is what Git does) is Version Control.</p>
<p>Therefore, Git is a Version Control System (VCS).</p>
<hr />
<h2 id="heading-prerequisites"><strong>Prerequisites</strong></h2>
<p>Before starting, ensure you have github account. To create an account on github follow below steps.</p>
<ol>
<li><p>Go to official site of Github <a target="_blank" href="https://github.com/">Official Site</a> and click on Sign up.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736182629738/a0c5be2b-40d0-4aa2-817e-74cadb79f454.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Then, enter your details and click on continue.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736183002956/eb7e4cfc-49d2-4d91-866d-9834e06c6417.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Then, fill the verification code and that’s it your account has been created.</p>
</li>
</ol>
<hr />
<h1 id="heading-installing-git">Installing Git</h1>
<h2 id="heading-for-windows">For Windows</h2>
<ul>
<li><p>Download Git from the <a target="_blank" href="https://git-scm.com/">official site.</a></p>
</li>
<li><p>Run the installer and select the default options.</p>
</li>
<li><p>Confirm installation by running <code>git --version</code> in Command Prompt.</p>
</li>
</ul>
<h2 id="heading-for-macos">For Macos</h2>
<ul>
<li><p>Install Git via Homebrew:</p>
<pre><code class="lang-bash">  bashCopy codebrew install git
</code></pre>
</li>
<li><p>Verify installation:</p>
<pre><code class="lang-bash">  bashCopy codegit --version
</code></pre>
</li>
</ul>
<h2 id="heading-for-linux">For Linux</h2>
<ul>
<li><p>Use the package manager for your distribution:</p>
<pre><code class="lang-bash">  bashCopy codesudo apt-get install git
</code></pre>
</li>
<li><p>Verify installation:</p>
<pre><code class="lang-bash">  bashCopy codegit --version
</code></pre>
</li>
</ul>
<hr />
<h1 id="heading-configuring-git">Configuring Git</h1>
<p>Now, let git now you who you are. Run these commands in your terminal to set up your username and email:</p>
<pre><code class="lang-bash">bashCopy codegit config --global user.name <span class="hljs-string">"Your Name"</span>
git config --global user.email <span class="hljs-string">"your.email@example.com"</span>
</code></pre>
<p><strong>Note:</strong> Use <code>global</code> to set the username and e-mail for <strong>every repository</strong> on your computer.</p>
<p>If you want to set the username/e-mail for just the current repo, you can remove <code>global</code></p>
<h3 id="heading-now-your-both-git-and-github-has-been-set-up-and-ready-to-use">Now, your both git and github has been set up and ready to use.</h3>
<hr />
<h3 id="heading-the-following-is-the-list-of-all-the-important-commands-with-its-description">The, following is the list of all the important commands with it’s description</h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Command</strong></td><td><strong>Description</strong></td></tr>
</thead>
<tbody>
<tr>
<td><code>git init</code></td><td>Initialize a new Git repository.</td></tr>
<tr>
<td><code>git clone &lt;url&gt;</code></td><td>Clone a repository from a URL.</td></tr>
<tr>
<td><code>git status</code></td><td>Show the status of the working directory.</td></tr>
<tr>
<td><code>git add &lt;file&gt;</code></td><td>Stage a file for commit.</td></tr>
<tr>
<td><code>git add .</code></td><td>Stage all changes in the current directory.</td></tr>
<tr>
<td><code>git commit -m "message"</code></td><td>Commit staged changes with a message.</td></tr>
<tr>
<td><code>git push</code></td><td>Push commits to a remote repository.</td></tr>
<tr>
<td><code>git pull</code></td><td>Fetch and merge changes from a remote repository.</td></tr>
<tr>
<td><code>git branch</code></td><td>List branches.</td></tr>
<tr>
<td><code>git branch &lt;name&gt;</code></td><td>Create a new branch.</td></tr>
<tr>
<td><code>git checkout &lt;branch&gt;</code></td><td>Switch to a specific branch.</td></tr>
<tr>
<td><code>git merge &lt;branch&gt;</code></td><td>Merge a branch into the current branch.</td></tr>
<tr>
<td><code>git log</code></td><td>View commit history.</td></tr>
<tr>
<td><code>git diff</code></td><td>Show differences between working files.</td></tr>
<tr>
<td><code>git reset &lt;file&gt;</code></td><td>Unstage a file.</td></tr>
<tr>
<td><code>git stash</code></td><td>Save changes without committing.</td></tr>
<tr>
<td><code>git stash pop</code></td><td>Reapply stashed changes.</td></tr>
<tr>
<td><code>git remote add &lt;name&gt; &lt;url&gt;</code></td><td>Add a remote repository.</td></tr>
<tr>
<td><code>git fetch</code></td><td>Download objects and refs from another repository.</td></tr>
<tr>
<td><code>git rebase &lt;branch&gt;</code></td><td>Reapply commits from one branch onto another.</td></tr>
</tbody>
</table>
</div><hr />
<h1 id="heading-git-and-github-guidelines">Git and GitHub Guidelines</h1>
<p>When you are working in the professional environment there are some rules and guidelines to follow to use git and github. The following are our Company’s guidelines which you have to follow for best practices and security.</p>
<h2 id="heading-1-repository-naming-and-management">1. Repository Naming and Management:-</h2>
<ul>
<li><p>Use meaningful and concise names for repository like <code>project-name</code>, <code>org-service-name</code>.</p>
</li>
<li><p>Grant appropriate permissions (e.g., read only for readers, write for collaborators)</p>
</li>
<li><p>Keep sensitive and confidential data in private repository.</p>
</li>
</ul>
<h2 id="heading-2-branching-strategy">2. Branching Strategy:-</h2>
<ul>
<li><p>Use <code>main</code> or <code>master</code> branch as a Primary branch for production ready code and protect it by enabling protection rules.</p>
</li>
<li><p>if you are adding a feature then it’s branch as a <code>feature/new-login-page</code>, for bugfix branch <code>bugfix/video-not-loading</code> etc.</p>
</li>
<li><p>Adopt a consistent naming for all branches.</p>
</li>
</ul>
<h2 id="heading-3-commit-and-pull-request-pr-guidelines">3. Commit and Pull Request (PR) Guidelines:-</h2>
<ul>
<li><p>Write a clear, concise and descriptive message for commit. for e.g., <code>feature(YourName): New login page</code>.</p>
</li>
<li><p>While creating a PR for merging any branch to main make sure you are providing a meaningful message and description of PR.</p>
</li>
<li><p>Test your feature properly before making any PR.</p>
</li>
</ul>
<h2 id="heading-4-code-review">4. Code Review:-</h2>
<ul>
<li><p>Use the GitHub review feature to suggest changes, comment on code, and approve PRs.</p>
</li>
<li><p>Encourage constructive feedback and focus on improving the code quality.</p>
</li>
<li><p>Take real time reviews from the collaborators and public.</p>
</li>
</ul>
<h2 id="heading-5-security-and-protection-of-code">5. Security and protection of Code:-</h2>
<ul>
<li><p>Maintain the sensitive and important code in the private repositories.</p>
</li>
<li><p>Use GitHub Personal Access Tokens instead of passwords.</p>
</li>
<li><p>Review repository access and permissions periodically.</p>
</li>
</ul>
<h3 id="heading-and-thats-it-you-are-ready-to-use-git-and-github-practice-more-and-more-to-put-your-hands-on-best-regards">And, that’s it you are ready to use Git and Github. Practice more and more to put your hands on. Best Regards! 🚀🎯</h3>
<h1 id="heading-team-chaicohort">Team:- ChaiCohort</h1>
<h1 id="heading-published-by-sanket-singh">Published By:- Sanket Singh</h1>
]]></content:encoded></item></channel></rss>