<?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[Monish's Blog]]></title><description><![CDATA[Monish's Blog]]></description><link>https://blog.bmonish.com</link><generator>RSS for Node</generator><lastBuildDate>Fri, 24 Apr 2026 04:55:49 GMT</lastBuildDate><atom:link href="https://blog.bmonish.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Tech Dive 1: MongoDB's ObjectId]]></title><description><![CDATA[MongoDB is a famous NoSQL Database. If you're just getting started with MongoDB, I would suggest you begin with Mongo University
Anatomy
MongoDB's ObjectID is made of 12 bytes. The 12 bytes consists of

a 4-byte timestamp.

a 5-byte random value gene...]]></description><link>https://blog.bmonish.com/tech-dive-1-mongodbs-objectid</link><guid isPermaLink="true">https://blog.bmonish.com/tech-dive-1-mongodbs-objectid</guid><category><![CDATA[MongoDB]]></category><category><![CDATA[mongoose]]></category><category><![CDATA[Databases]]></category><category><![CDATA[NoSQL]]></category><category><![CDATA[#NoSQLDatabase]]></category><dc:creator><![CDATA[Monish B]]></dc:creator><pubDate>Mon, 03 Jun 2024 05:30:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1717395284214/094f33bf-a372-4eae-9d32-59ad4e67258c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>MongoDB is a famous NoSQL Database. If you're just getting started with MongoDB, I would suggest you begin with <a target="_blank" href="https://learn.mongodb.com/">Mongo University</a></p>
<h2 id="heading-anatomy">Anatomy</h2>
<p>MongoDB's ObjectID is made of 12 bytes. The 12 bytes consists of</p>
<ul>
<li><p>a 4-byte timestamp.</p>
</li>
<li><p>a 5-byte random value generated once per process.</p>
</li>
<li><p>a 3-byte incrementing counter initialized to a random value.</p>
</li>
</ul>
<p>Example:</p>
<pre><code class="lang-markdown">65f87920068c7d17cb1288d6
</code></pre>
<p><code>65f87920</code> - <a target="_blank" href="https://en.wikipedia.org/wiki/Unix_time">Unix Epoch</a> Timestamp</p>
<p><code>068c7d17cb</code> - Random Value</p>
<p><code>1288d6</code> - Incrementing Counter</p>
<h2 id="heading-constructing-objectid">Constructing ObjectId</h2>
<p>You can use the <code>ObjectId()</code> method to construct a new ObjectId.</p>
<p>Optionally, it can take two inputs.</p>
<ol>
<li><p><code>hexadecimal</code> - A 24-character hexadecimal string value.</p>
</li>
<li><p><code>integer</code> - The integer value, in seconds, is added to the Unix epoch to create the new timestamp.</p>
<p> Example:</p>
<pre><code class="lang-bash"> &gt; ObjectId(10)
 &lt; ObjectId(<span class="hljs-string">'0000000a0d098c2eda0f296e'</span>)
</code></pre>
</li>
</ol>
<h2 id="heading-methods-you-can-use-on-objectid">Methods you can use on ObjectId</h2>
<h3 id="heading-gettimestamp">getTimestamp()</h3>
<p><img src="https://media3.giphy.com/media/v1.Y2lkPTc5MGI3NjExemFmMzU5aHpxbTZxbTFmYm94N2R5cXRsYWlscTlrdjc2aGJpbTd3diZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/QBd2kLB5qDmysEXre9/giphy.gif" alt="Movie gif. Rowan Atkinson as Mr. Bean in Mr. Bean's Holiday, stands in a field of yellow flowers on a windy day. He looks off into the distance and then at his watch, before scratching his head. " class="image--center mx-auto" /></p>
<p>Since the timestamp is included in the ObjectId, you can retrieve the time in which the ObjectId was generated.</p>
<pre><code class="lang-bash">&gt; ObjectId(<span class="hljs-string">'665377378755af3d1e7c5701'</span>).getTimestamp()
&lt; 2024-05-26T17:53:59.000Z

&gt; ObjectId(<span class="hljs-string">'0000000a0d098c2eda0f296e'</span>).getTimestamp()
&lt; 1970-01-01T00:00:10.000Z
</code></pre>
<h3 id="heading-tostring">toString()</h3>
<p>You can use this method in case if you want to convert the ObjectId to hexadecimal string.</p>
<pre><code class="lang-bash">&gt; ObjectId(<span class="hljs-string">'665b4d520d098c2eda0f296d'</span>).toString()
&lt; 665b4d520d098c2eda0f296d
</code></pre>
<hr />
<p>If you’re a tech enthusiast and resonate with my content, follow me on <a target="_blank" href="https://www.linkedin.com/in/bmonish/">LinkedIn</a>, <a target="_blank" href="https://github.com/bmonish">GitHub</a>, and <a target="_blank" href="https://twitter.com/iammonishb">Twitter</a>.</p>
]]></content:encoded></item><item><title><![CDATA[Top 5 React Hooks]]></title><description><![CDATA[React hooks were introduced in React 16.8 to use State and other React Features. It lets you hook into the features without needing to create Classes.
1. useState
This might be the first hook you heard about when learning React. It is very common and...]]></description><link>https://blog.bmonish.com/top-5-react-hooks</link><guid isPermaLink="true">https://blog.bmonish.com/top-5-react-hooks</guid><category><![CDATA[React]]></category><category><![CDATA[ReactHooks]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Monish B]]></dc:creator><pubDate>Mon, 30 Oct 2023 18:37:36 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1698724431676/2b02ca97-7593-409b-aa95-782df3ca41c0.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>React hooks were introduced in React 16.8 to use State and other React Features. It lets you hook into the features without needing to create Classes.</p>
<h3 id="heading-1-usestate">1. useState</h3>
<p>This might be the first hook you heard about when learning React. It is very common and can be very useful. </p>
<p>As the name suggests it creates a State Variable. This hook helps us to preserve the variables even after the function exits.</p>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> React, { useState } <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;

<span class="hljs-keyword">const</span> App = <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-keyword">const</span> [count, setCount] = useState(<span class="hljs-number">0</span>);

  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>You clicked {count} times<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{()</span> =&gt;</span> setCount(count + 1)}&gt;
        Click me
      <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre>
<p>The hook returns two values: the current <code>value</code> and a <code>function</code> to update the value.</p>
<hr />
<h3 id="heading-2-useeffect">2. useEffect</h3>
<p>Another common hook is the <code>useEffect</code>. This is similar to the <code>componentDidMount</code> in Class Components.</p>
<p>They are used to run side effects. They are mainly used when you want to perform any manipulations with every state change or when only a  certain value changes.</p>
<p>Let's use the previous example and use <code>useEffect</code> to log the value of count every time it changes.</p>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> React, { useState, useEffect } <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;

<span class="hljs-keyword">const</span> App = <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-keyword">const</span> [count, setCount] = useState(<span class="hljs-number">0</span>);

  useEffect(<span class="hljs-function">() =&gt;</span> {
      <span class="hljs-built_in">console</span>.log(count);
  }, [count]);

  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>You clicked {count} times<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{()</span> =&gt;</span> setCount(count + 1)}&gt;
        Click me
      <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}
</code></pre>
<p>You can also return a function from <code>useEffect</code> to do any clean up. It is executed when the component unmounts.</p>
<pre><code class="lang-js">useEffect(<span class="hljs-function">() =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(count);

  <span class="hljs-keyword">return</span> <span class="hljs-function">() =&gt;</span> {
    setCount(<span class="hljs-number">0</span>);
  };
}, [count]);
</code></pre>
<hr />
<h3 id="heading-3-usememo">3. useMemo</h3>
<p>This hooks is used to keep expensive functions from running again and again. They return a <code>memoized</code> value and are updated only when one of the dependencies update.</p>
<p>Let us consider that we have two state variables and an resource intensive / expensive function that takes one of the variables as param.</p>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> React, { useState, useEffect } <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;

<span class="hljs-keyword">const</span> App = <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-keyword">const</span> [count, setCount] = useState(<span class="hljs-number">0</span>);
  <span class="hljs-keyword">const</span> [todos, setTodos] = useState([]);
  <span class="hljs-keyword">const</span> calculation = expensiveCalculation(count);

  useEffect(<span class="hljs-function">() =&gt;</span> {
      <span class="hljs-built_in">console</span>.log(count);
  }, [count]);

  <span class="hljs-keyword">const</span> addTodo = <span class="hljs-function">(<span class="hljs-params">todo</span>) =&gt;</span> {
     setTodos(<span class="hljs-function"><span class="hljs-params">t</span> =&gt;</span> [...t, <span class="hljs-string">'todo'</span>];
  }

  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>You clicked {count} times<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{()</span> =&gt;</span> setCount(count + 1)}&gt;
        Click me to increase Count
      <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{()</span> =&gt;</span> addTodo("Example Todo 1")}&gt;
        Click me to set Todo
      <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
}

<span class="hljs-keyword">const</span> expensiveCalculation = <span class="hljs-function">(<span class="hljs-params">num</span>) =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Calculating..."</span>);
  <span class="hljs-comment">// Do some Intensive Task</span>
  <span class="hljs-keyword">return</span> num;
};
</code></pre>
<p>In the above example even though the calculation doesn't have anything to do with todo, we can see that the calculation is done for every render even when the count value hasn't been updated.</p>
<p>To fix this we can simply wrap the function in a <code>useMemo</code> hook and pass in count as the dependency.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> calculation = useMemo(<span class="hljs-function">() =&gt;</span> expensiveCalculation(count), [count]);
</code></pre>
<p>This will make sure that the calculation is calculated only when the count value gets updated.</p>
<hr />
<h3 id="heading-4-usecallback">4. useCallback</h3>
<p>The <code>useCallback</code> and <code>useMemo</code> Hooks are similar. The main difference is that useMemo returns a memoized value and useCallback returns a memoized function. Let's modify the above example to create a child component to visualize the use of <code>useCallback</code> better.</p>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> React, { useState, useCallback } <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;
<span class="hljs-keyword">import</span> Todos <span class="hljs-keyword">from</span> <span class="hljs-string">"./Todos"</span>;

<span class="hljs-keyword">const</span> App = <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-keyword">const</span> [count, setCount] = useState(<span class="hljs-number">0</span>);
  <span class="hljs-keyword">const</span> [todos, setTodos] = useState([]);

  <span class="hljs-keyword">const</span> addTodo = <span class="hljs-function">(<span class="hljs-params">todo</span>) =&gt;</span> {
    setTodos(<span class="hljs-function">(<span class="hljs-params">t</span>) =&gt;</span> [...t, <span class="hljs-string">"todo"</span>]);
  };

  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>You clicked {count} times<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{()</span> =&gt;</span> setCount(count + 1)}&gt;
        Click me to increase Count
      <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">Todos</span> <span class="hljs-attr">todos</span>=<span class="hljs-string">{todos}</span> <span class="hljs-attr">addTodo</span>=<span class="hljs-string">{addTodo}</span> /&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
};
</code></pre>
<pre><code class="lang-js"><span class="hljs-comment">// Todos.js</span>
<span class="hljs-keyword">import</span> { memo } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;

<span class="hljs-keyword">const</span> Todos = <span class="hljs-function">(<span class="hljs-params">{ todos, addTodo }</span>) =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"child render"</span>);
  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>My Todos<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
      {todos.map((todo, index) =&gt; {
        return <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">key</span>=<span class="hljs-string">{index}</span>&gt;</span>{todo}<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>;
      })}
      <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{addTodo}</span>&gt;</span>Add Todo<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;/&gt;</span></span>
  );
};

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> memo(Todos);
</code></pre>
<p>When we try to increase the count, we can see that the Todos component is also getting re rendered. It is because every time a component gets re-rendered, its functions get recreated. Due to this the <code>addTodo</code> function isn't the same function as before.</p>
<p>To prevent this, we can use the <code>useCallback</code> hook.</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> addTodo = useCallback(<span class="hljs-function">() =&gt;</span> {
    setTodos(<span class="hljs-function">(<span class="hljs-params">t</span>) =&gt;</span> [...t, <span class="hljs-string">"New Todo"</span>]);
  }, [todos]);
</code></pre>
<p>Now <code>Todos</code> will get re-rendered only when <code>todos</code> prop changes.</p>
<hr />
<h3 id="heading-5-useref">5. useRef</h3>
<p>The <code>useRef</code> Hook allows you to persist values between renders.</p>
<p>It can be used to access a DOM element directly.</p>
<p>In React, we can add a <code>ref</code> attribute to an element to access it directly in the DOM.</p>
<p>Here's a simple example to see how you can access DOM elements using useRef.</p>
<pre><code class="lang-js"><span class="hljs-keyword">import</span> React, { useRef } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;

<span class="hljs-keyword">const</span> App = <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-keyword">const</span> inputElement = useRef();

  <span class="hljs-keyword">const</span> focusInput = <span class="hljs-function">() =&gt;</span> {
    inputElement.current.focus();
  };

  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text"</span> <span class="hljs-attr">ref</span>=<span class="hljs-string">{inputElement}</span> /&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onClick</span>=<span class="hljs-string">{focusInput}</span>&gt;</span>Focus Input<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;/&gt;</span></span>
  );
};

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> App;
</code></pre>
<hr />
<p>Apart from this, there is much more you can do with hooks. You can even create your own hooks. Check this doc from the <a target="_blank" href="https://reactjs.org/docs/hooks-custom.html">React Docs</a> site to learn more about how you can achieve it.</p>
<p>If you found this article helpful, do share it with your friends. </p>
]]></content:encoded></item><item><title><![CDATA[GitHub 101: Uploading Files to a New Repository via Command Line]]></title><description><![CDATA[So at this point I assume you should know How to create a Repository, If you don't do checkout my previous  article here.
Let's dive in and add files via the Command Line.

Follow the steps 1, 2 and 3 from my  previous article! 

Once done, You shoul...]]></description><link>https://blog.bmonish.com/github-101-uploading-files-to-a-new-repository-via-command-line</link><guid isPermaLink="true">https://blog.bmonish.com/github-101-uploading-files-to-a-new-repository-via-command-line</guid><category><![CDATA[GitHub]]></category><category><![CDATA[cli]]></category><category><![CDATA[remote]]></category><category><![CDATA[repository]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Monish B]]></dc:creator><pubDate>Sun, 02 May 2021 10:12:02 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1619950098051/5Pmfdsiav.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>So at this point I assume you should know <em>How to create a Repository,</em> If you don't do checkout my previous  <a target="_blank" href="https://bmonish.hashnode.dev/github-101-creating-a-new-repository-in-github">article here</a>.</p>
<p>Let's dive in and add files via the Command Line.</p>
<ol>
<li><p>Follow the steps 1, 2 and 3 from my  <a target="_blank" href="https://bmonish.hashnode.dev/github-101-creating-a-new-repository-in-github">previous article!</a> </p>
</li>
<li><p>Once done, You should see a screen like this.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619949018203/pdRrHwyxQ.png" alt="image.png" /></p>
</li>
<li><p>Assuming you have a folder created in your local machine, Open the terminal and redirect to the project directory. (I have three files with boilerplate code)
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619949199040/2jVJRMaIR.png" alt="image.png" /></p>
</li>
<li><p>Run the following command to <em>Initialize</em> the repository.</p>
<p> <code>git init</code> 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619949300204/F-Ifzmdo3.png" alt="image.png" /></p>
</li>
<li><p>Now you have to let your machine know which remote repository you're planning to work on. To do that copy the <code>git remote add origin &lt;url&gt;</code> line from the 3rd step and execute it.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619949432509/4clBgyhoH.png" alt="image.png" /></p>
</li>
<li><p>To add all files run <code>git add .</code> or you can add only a specific file by executing <code>git add index.html</code> The former will add files to the changing area and the later will add only the <em>index.html</em> file.</p>
</li>
<li><p>After running the commands, If you want to check the status of your working directory execute <code>git status</code>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619949624327/hryE_Jdxs.png" alt="image.png" /> It will give you an overview of the changes that are tracked and has been added to the stage.</p>
</li>
<li><p>Now, to create a commit execute <code>git commit -m"&lt;Desc. of your commit&gt;"</code></p>
</li>
<li><p>Finally push your changes by executing <code>git push origin &lt;branch name&gt;</code>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619949999566/1RSayqN6c.png" alt="image.png" /></p>
</li>
<li><p>You should now see your files in the repository!
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619950078663/kZyVw8dFW.png" alt="image.png" /></p>
</li>
</ol>
<hr />
<p><em>Feel free to drop your suggestions in the comments and if you find it useful give me a like and share it with someone who might benefit from it.</em></p>
<p><em>Reach out to me on my Instagram  <a target="_blank" href="https://www.instagram.com/monish.codes/">@monish.codes</a> If you have any queries or just want to have a conversation! See you on the flip side.</em></p>
]]></content:encoded></item><item><title><![CDATA[GitHub 101: Creating a New Repository in GitHub]]></title><description><![CDATA[As a software engineer, learning a version control tool is one of the best things you can have in your bag. 
Right off the bat, I want to clear this doubt many people have!

Is Git and GitHub the same?

The answer is NO! In order to explain it in sim...]]></description><link>https://blog.bmonish.com/github-101-creating-a-new-repository-in-github</link><guid isPermaLink="true">https://blog.bmonish.com/github-101-creating-a-new-repository-in-github</guid><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><category><![CDATA[beginner]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Monish B]]></dc:creator><pubDate>Sun, 25 Apr 2021 08:09:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1619338124216/hXL4OCljE.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As a software engineer, learning a version control tool is one of the best things you can have in your bag. </p>
<p>Right off the bat, I want to clear this doubt many people have!</p>
<blockquote>
<p>Is Git and GitHub the same?</p>
</blockquote>
<p>The answer is <em>NO!</em> In order to explain it in simpler terms,</p>
<ul>
<li><p><strong>Git</strong> is a version control system that lets you manage and keep track of your source code history.</p>
</li>
<li><p><strong>GitHub</strong> is a cloud based hosting service that lets you manage <em>Git</em> Repositories.</p>
</li>
</ul>
<h1 id="how-to-create-a-github-repository">How to create a GitHub Repository?</h1>
<ol>
<li><p><strong><em>Signup</em></strong> for your GitHub account  <a target="_blank" href="https://github.com/">here.</a>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619335328218/MZU9j-O0n.png" alt="image.png" /></p>
</li>
<li><p>After you create an account, you should see a create <strong>New</strong> repository button.
You can also  <a target="_blank" href="https://github.com/new">click this link.</a>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619336561654/dAb1zu_Q9.png" alt="image.png" /></p>
</li>
<li><p>Fill in the repository <strong>Name, Description and the Visibility (Public / Private).</strong> And then Click <strong><em>Create Repository.</em></strong></p>
</li>
<li><p>Once done, You should see a screen like this. <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619337531473/7BLFBdU3x.png" alt="image.png" /> There are many ways that you can add files to the repository. But in this article we will see how to <strong>directly upload existing files.</strong></p>
</li>
<li><p>Click <strong><em>upload an existing file</em></strong> and in the following page you will be able to upload files from your local machine.</p>
</li>
<li><p>Once uploaded, you can add a <strong>Commit Title and Description</strong> to make it more meaningful. <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619338038584/fDiIcq6fS.png" alt="image.png" /> And then Click <em>Commit Changes.</em></p>
</li>
<li><p>Voila! You have created your <strong>First Repository</strong>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1619338101680/3qEkfhwhg.png" alt="image.png" /></p>
</li>
</ol>
]]></content:encoded></item></channel></rss>