<?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: Ankith Deegoju</title>
    <description>The latest articles on DEV Community by Ankith Deegoju (@ankith_deegoju_155982c916).</description>
    <link>https://dev.to/ankith_deegoju_155982c916</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1778213%2F5003112a-5d77-4bb9-91a3-cd038a7bd1a6.png</url>
      <title>DEV Community: Ankith Deegoju</title>
      <link>https://dev.to/ankith_deegoju_155982c916</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ankith_deegoju_155982c916"/>
    <language>en</language>
    <item>
      <title>Internet - A Basic Overview</title>
      <dc:creator>Ankith Deegoju</dc:creator>
      <pubDate>Sun, 12 Jul 2026 12:58:35 +0000</pubDate>
      <link>https://dev.to/ankith_deegoju_155982c916/internet-a-basic-overview-5bi7</link>
      <guid>https://dev.to/ankith_deegoju_155982c916/internet-a-basic-overview-5bi7</guid>
      <description>&lt;h3&gt;
  
  
  What is a network?
&lt;/h3&gt;

&lt;p&gt;In the context of Internet, network can be a group of devices which are connected with each other. &lt;/p&gt;

&lt;p&gt;What do you mean by &lt;em&gt;inter&lt;/em&gt;? That is among the devices. The network which is among all the devices can be roughly termed as &lt;em&gt;Internet&lt;/em&gt;. Okay, extending this definition, Internet can be called as a network of networks which is providing capability to connect with everyone around the world. &lt;/p&gt;

&lt;p&gt;We have another term called &lt;em&gt;Intranet&lt;/em&gt;. Internet has two terms, intra and net. Net again here refers to network. Intra means within a group or which is limited to a small area or within people. For example, a network which is within a campus or within an institution or within an office can be termed as an intranet.&lt;/p&gt;

&lt;p&gt;These are just &lt;strong&gt;fun&lt;/strong&gt; to have definitions and are not completely correct. &lt;/p&gt;

&lt;p&gt;If we deep dive into the technical aspect of Internet, especially for CS grads or engineers, we can think of Internet as a hybrid distributed system. I'll explain you why. &lt;/p&gt;

&lt;p&gt;Hybrid in the sense it's not completely centralized/controlled by a central authority, neither is it completely decentralized.   &lt;/p&gt;

&lt;p&gt;Distributed. Why is it &lt;em&gt;distributed&lt;/em&gt;? Because Internet is not operating from a single central server or something like that. It is controlled by many individual organizations which are distributed across the world. &lt;/p&gt;

&lt;p&gt;Firstly to understand Internet better, I think we should answer the question, how and why did we build it? Let's go into the background of how Internet was in the first place.&lt;/p&gt;

&lt;h3&gt;
  
  
  Background-
&lt;/h3&gt;

&lt;p&gt;Internet was a project started by &lt;em&gt;DARPA&lt;/em&gt; . DARPA stands for Defense Advanced Research Project Agency started during the Cold War ensuring development in terms of technologies by USA as a consequence of the launch of Sputnik 1 by Russia. [This is not the exact history, a rough idea is assumed for simplicity]&lt;/p&gt;

&lt;p&gt;Initially, an organization called ARPA, Advanced Research Project Agency, has developed a network called as ARPANET. &lt;/p&gt;

&lt;p&gt;Why was this developed? This was developed to provide/enable communication systems for universities, research organizations, defense forces. &lt;/p&gt;

&lt;p&gt;United States Defense Agency has funded the project and it has eventually evolved into Internet. We will understand what were the requirements of the network which they wanted to develop. The requirements were simple. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Decentralization&lt;/em&gt; - There should be no single point of control over the communication architecture.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Interoperability&lt;/em&gt; - Any device should be capable to operate/connect within the network. There should be no constraint of devices or hardware, something like that.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Survivability&lt;/em&gt; - In case of any failure within the network or a small component within the network has been compromised or failed, the network should survive/it should work. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Scalability&lt;/em&gt; - The network should be scalable. It should scale to many, many number of devices.&lt;/p&gt;

&lt;p&gt;We have developed entire architecture based on the mechanisms that met our requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture
&lt;/h3&gt;

&lt;p&gt;Initially an architecture to implement the Internet was &lt;em&gt;OSI&lt;/em&gt; model. We can read about it, but it's a theoretical model which was presented. Now we will deep dive into practical model, &lt;em&gt;&lt;strong&gt;TCP/IP&lt;/strong&gt;&lt;/em&gt; model which is used by us right now.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TCP|IP&lt;/strong&gt; model follows a layered approach in which we have allocated specific functionalities associated with each layer so that we can ensure the functionality of the internet to be more robust.&lt;/p&gt;

&lt;p&gt;Each layer is beautifully designed/made up so that it deals only with a particular component of the infrastructure. Each layer is agnostic of the above layer i.e. considers entire above layer data as payload.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Application layer&lt;/em&gt; is used to enable communication between applications/software which are built into the devices. Some of the protocols which application layer uses are HTTP, SMTP. &lt;em&gt;HTTP&lt;/em&gt; is generally used by web applications, SMTP it’s used for mailing services. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Transport layer&lt;/em&gt; is used for process-to-process communication, it's mostly handled by operating system, and there are two main protocols within transport layer which the processes use to communicate, TCP and UDP. TCP stands for Transport Control Protocol, UDP stands for User Datagram Protocol. &lt;/p&gt;

&lt;p&gt;The next layer which we have is network layer. It is also known as, IP layer as IP [ &lt;em&gt;Internet Protocol&lt;/em&gt; ] protocol is and it deals with the routing of information between two devices within the network. It's the protocol which is used by all the data packets within the network. It is implemented by OS and partially by routers. &lt;/p&gt;

&lt;p&gt;IP is not a single protocol, it's a protocol suite. It is sued to provision each device within the network a unique IP address to identify the device in the network. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We use IP addresses to navigate the device in Internet, but data is transferred form one device to another using MAC address of the device.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;MAC layer&lt;/em&gt; is used to communicate with the very next device/ hop-to-hop delivery [ I will explain this part in later section ]  within a network or within a network among switches, bridges to reach. This layer involves used by intermediate hardware devices for forwarding data packets. There are many protocols within MAC layer, such as we have CSMA-CA for wireless transfer of data, other protocols such as FDM, TDM, token passing protocols etc. We need to understand MAC a bit in a different sense. This is useful for communication between hardware devices within a network/intranet. This layer functionality is implemented by NIC [ Network Interface Card ] within the device.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Physical layer&lt;/em&gt;, it deals with modulation, demodulation, converting the data into electrical signals or waves. In physical layer, we have wires, fiber optics, etc. &lt;/p&gt;

&lt;p&gt;If you observe we have divided our architecture into these layers based on the specific functionality associated with each layer. Each layer is very much different from one another. This gives us modularity / feel of loose-coupling where components and functionality of a layer are neither constrained nor are attached together with other layers. Even if there is an issue with one part of the system, you can just get into that layer and fix the issues at that layer without interrupting the entire system. &lt;/p&gt;

&lt;p&gt;Each layer works with the help of protocols of the layer. What are protocols? Protocols can be considered as a system of rules which are followed by devices to enable communication between them. &lt;/p&gt;

&lt;p&gt;We have HTTP, an application layer protocol to transfer HTML files or images, text, everything else among applications. We have TCP protocol to communicate with the other process running on the other device and many more.&lt;/p&gt;

&lt;h3&gt;
  
  
  Working part -
&lt;/h3&gt;

&lt;p&gt;Let’s see how the system works from end to end? We'll explain using a small diagram. You can get a better idea/feel of what these layers are and how are they communicating with one another.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkz7x6rwywvc9xgxxzpeg.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkz7x6rwywvc9xgxxzpeg.png" alt="An illustration of how data is transferred from one layer to another in the Internet architecture" width="799" height="238"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Few important concpets to understand the diagrams below  -&lt;/p&gt;

&lt;p&gt;How IP's are allocated to a system within a network.&lt;br&gt;
Whenever your device is connected to WIFI | LAN it will be dynamically allocated a IP address via ARP | DHCP by a router. [&lt;em&gt;Try to learn about subnetting and Classless Interdoamin Routing [CIDR].&lt;/em&gt;]&lt;/p&gt;

&lt;p&gt;Port - Number associated with a process assigned by OS to uniquely identify the process among other running processes.&lt;/p&gt;

&lt;p&gt;Whever a router receives a MAC packet from a device it processes the IP address within it, perform pattern matching with all routes available in its routing table and chooses the closest route matched to the dest IP of the packet and forwards it to the device in the matched route by attaching its own MAC header.This process is called hop - hop delivery.&lt;/p&gt;

&lt;p&gt;I have run a experiment where I have used one of the systems within my college LAN that behaves as an client and other system behaves as an server.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://excalidraw.com/#json=EJ_kQtEa6xQicaqsuE9o3,oVqpq-nNal2OE8fJsztVKg" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fexcalidraw.com%2Fog-image-3.png" height="450" class="m-0" width="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://excalidraw.com/#json=EJ_kQtEa6xQicaqsuE9o3,oVqpq-nNal2OE8fJsztVKg" rel="noopener noreferrer" class="c-link"&gt;
            Excalidraw Whiteboard
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Excalidraw is a virtual collaborative whiteboard tool that lets you easily sketch diagrams that have a hand-drawn feel to them.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fexcalidraw.com%2Ffavicon-32x32.png" width="32" height="32"&gt;
          excalidraw.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;em&gt;Device - A&lt;/em&gt; Server - Acting as a  Server - Campus Wifi connected Laptop&lt;br&gt;
IP Address - 172.24.135.46 [ Assigned by Router to my device]&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Device - B&lt;/em&gt;  Client - LAN Connected System &lt;br&gt;
IP Address - 10.9.68.25 [Private IP] &lt;/p&gt;

&lt;p&gt;Here we did not use any application layer protocol like HTTP, SMTP as we configured our own simple format to communicate with each other using simple commands.&lt;/p&gt;

&lt;p&gt;TCP Layer uses ports and configures socket connection at both ends using socket data structure formed by src port, src IP address, dest port, dest IP address.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion-
&lt;/h3&gt;

&lt;p&gt;Internet is a system involving entire ecosystem of multiple devices and multiple applications within it. It's not a single thing or a single entity. That is the major idea what I wanted to drive or derive out of this blog/video. &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Understanding of GIT by implementation</title>
      <dc:creator>Ankith Deegoju</dc:creator>
      <pubDate>Fri, 15 May 2026 06:56:11 +0000</pubDate>
      <link>https://dev.to/ankith_deegoju_155982c916/basics-of-git-part-2-25n6</link>
      <guid>https://dev.to/ankith_deegoju_155982c916/basics-of-git-part-2-25n6</guid>
      <description>&lt;p&gt;In this blog we will explore the concept of -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Branches&lt;/li&gt;
&lt;li&gt;Push, pull, merge&lt;/li&gt;
&lt;li&gt;Pull Request and how can we contribute to any repo.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To understand above concepts we will follow a hands on approach of doing things - &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Repo - Repository - Folder tracked by Git.&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Methods to access an existing repo -
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Directly download the repo from GitHub and open it in our terminal&lt;/li&gt;
&lt;li&gt;We can fork the repo using fork button on github - This creates your own copy of the repo.&lt;/li&gt;
&lt;li&gt;We can use git clone command to clone the repo locally.
Command - git clone “Add repo-link  here”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will understand the concepts of cloning,  remote conenction establishment, branching through the below steps.&lt;/p&gt;

&lt;p&gt;Let’s create a new repo in GitHub. I have created a test_repo.&lt;/p&gt;

&lt;p&gt;We get something like this  -&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%2Fwmdv6gbsowz3f83x25ta.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%2Fwmdv6gbsowz3f83x25ta.png" alt=" " width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy the link here.&lt;/p&gt;

&lt;p&gt;Use the git clone command to clone the repo locally - &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%2F06m5h1zinb3nl5n0sen1.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%2F06m5h1zinb3nl5n0sen1.png" alt=" " width="799" height="78"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s add a few files into it and we will also use some of the commands from our previous blog to add the files into staging, commit the changes, then push the code into GitHub.&lt;/p&gt;

&lt;p&gt;I have created two files in the repo. [ You can refer prev blog / google it to create files in a repo ]&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%2Fd34d8dlk288d4dteqmcu.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%2Fd34d8dlk288d4dteqmcu.png" alt=" " width="707" height="191"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To push the code to GitHub we need to establish a remote connection with the GitHub repo. By default a remote connection with name origin is created if we use git clone command.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Why do we want to push code - Everyone with the repo link can view the updates in the code.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Command to establish remote connection - git remote add “remote-connection-name” “repo-link” &lt;/p&gt;

&lt;p&gt;To view all existing remote connections in that repo .&lt;br&gt;
Command - git remote -v&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%2F0vwdmt93jvokyh60noej.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%2F0vwdmt93jvokyh60noej.png" alt=" " width="800" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can remove connection using command - git remote remove “remote-connection-name” .&lt;/p&gt;

&lt;p&gt;Suppose we want to develop a project and we have a team of developers.  We create a repo on GitHub. We then add a remote connection to that repo via our terminal, to make changes in our local system independently and then push those changes to the repo. &lt;/p&gt;

&lt;p&gt;Why do we create a remote connection - To make changes locally in our system verify them once if they are properly working from our side and then pushing those to the github for the team to look into and review before deploying it. &lt;/p&gt;

&lt;p&gt;I have also forked a public repo for example and did few things in the code.&lt;br&gt;
Ex- git remote add origin &lt;a href="https://github.com/NirDiamant/RAG_Techniques.git" rel="noopener noreferrer"&gt;https://github.com/NirDiamant/RAG_Techniques.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To view all existing remote connections  - git remote -v&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%2Fqcbnpd3my7iohk6c51x8.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%2Fqcbnpd3my7iohk6c51x8.png" alt=" " width="798" height="134"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Generally what happens is the repo’s MAIN / MASTER branch is generally connected to the hosting platform where our application in deployed [This is not always true]. Any changes to the MASTER branch will be reflecting in our production directly. To avoid any unnecessary issues , the MASTER branch of the repo is locked so that none of the developers can directly push the code to the production without proper check . So each developer creates a separate branch of the same repo, makes his/her changes then  raises a pull request [PR], the manager / testing team after verification of the changes pushes the code into MASTER branch.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;By default after cloning a repo, a MASTER branch is created in the local repo, which will be connected to the MASTER branch of the repo. &lt;/p&gt;

&lt;p&gt;In my local experiments the default branch name is MASTER. Modern GitHub repositories use main by default not MASTER.&lt;/p&gt;

&lt;p&gt;We need to use remote connection name and branch name to push changes into GitHub / MASTER branch.&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%2Fjt1qeb02j064z9frdnvd.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%2Fjt1qeb02j064z9frdnvd.png" alt=" " width="800" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What is a branch - Independent line of development&lt;/p&gt;

&lt;p&gt;How do we create branches - Using command &lt;br&gt;
git branch  &lt;/p&gt;

&lt;p&gt;To view all existing branches - git branch -a&lt;br&gt;
Naming convention followed while creating branches- Developer Name/Feature Name&lt;/p&gt;

&lt;p&gt;Fetch - Used to download the latest updates from GitHub repository and updates the remote tracking branch like remotes/origin/MASTER, without modifying our local working branch.&lt;/p&gt;

&lt;p&gt;Use command - git fetch origin [ This fetches all branches from origin]&lt;/p&gt;

&lt;p&gt;git fetch origin "branch-name" [ The changes are fetched from the specified branch name ]&lt;/p&gt;

&lt;p&gt;We will manually add few changes in our repo from GitHub to understand fetch command in the GitHub repo. I have added changes in the two base files created via GitHub web app.&lt;/p&gt;

&lt;p&gt;To compare changes from your local repo MASTER branch to the github repo’s MASTER branch we use - git diff MASTER origin/MASTER&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%2Fra9j5ml3ew2934crnb64.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%2Fra9j5ml3ew2934crnb64.png" alt=" " width="800" height="590"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So we have made changes directly in the MASTER branch of repo in the GitHub.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Using fetch command we can compare our repo code with latest github repo code and if needed the new changes can be copied into our local repo to maintain sync with the  changes in the repo.&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;Branching - Switch command&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%2Fcq2oz1298hztk4t83isr.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%2Fcq2oz1298hztk4t83isr.png" alt=" " width="800" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can update our repo with the newly made changes using git pull command. But we need to set upstream for a branch to enable push and pull changes. This upstream links a local branch to a remote branch. &lt;/p&gt;

&lt;p&gt;Command - git branch —set-upstream-to=origin/MASTER&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%2Fuu8m86rtifaa4uairkfb.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%2Fuu8m86rtifaa4uairkfb.png" alt=" " width="800" height="79"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we can pull changes using pull command - &lt;/p&gt;

&lt;p&gt;git pull origin [If upstream is already set- fetch and merge latest changes into the current local branch from the connected remote branch] &lt;/p&gt;

&lt;p&gt;git pull origin "branch-name" [ The changes are pulled into the specifed branch name ]&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%2Fvhopoil9vcdiju79et3k.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%2Fvhopoil9vcdiju79et3k.png" alt=" " width="695" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To observe all the commit history of the branch - We can do it using command git log —oneline. &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%2F24nr026w5inbng7mgfsu.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%2F24nr026w5inbng7mgfsu.png" alt=" " width="797" height="126"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The branch Ankith/Feat1 is at commit 7864cda i.e. behind the MASTER branch of the local repo by two commits. So now we can merge these changes in  Ankith/feat1 branch from the MASTER branch of local repo to keep all the branches in sync. &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%2F7xbtj13ee8rxzngq82tj.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%2F7xbtj13ee8rxzngq82tj.png" alt=" " width="713" height="160"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Explore checkout and restore commands in git.&lt;/p&gt;

&lt;p&gt;Let’s understand merge -— squash . Suppose we make multiple commits in Ankith/feat1 branch . &lt;/p&gt;

&lt;p&gt;Head pointer in the git always points the currently executed / checked-out commit. &lt;/p&gt;

&lt;p&gt;Here we did few commits in the specific branch - Ankith/Feat1&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%2Fgb5fxpfiqnoddx0m1r5g.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%2Fgb5fxpfiqnoddx0m1r5g.png" alt=" " width="799" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we use merge command all the three commits are merged into MASTER . &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%2Fomc4c2xpekrqheiybkfs.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%2Fomc4c2xpekrqheiybkfs.png" alt=" " width="800" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Instead we can also merge all the commits of Ankith/feat1 into MASTER branch using single commit by squashing all the commits into a single commit.&lt;/p&gt;

&lt;p&gt;As we merge the changes from Ankith/feat1 branch to MASTER branch, the changes are placed into staging area.  On commit operation these changes are made to MASTER branch with a single commit.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Generally we delete the branch once the changes are pushed to MASTER branch.&lt;/em&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%2Fnj7ap334ou50fhwf2tx4.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%2Fnj7ap334ou50fhwf2tx4.png" alt=" " width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pushing - To push changes made in  the local MASTER branch into Github &lt;br&gt;
Command - git push origin.&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%2F7edbw6hxa8ukdcsplx1o.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%2F7edbw6hxa8ukdcsplx1o.png" alt=" " width="785" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Rebase -  Suppose we  have two branches Ankith/Feat2, MASTER. Suppose my friend has added many features into the MASTER branch. In this case of many changes in a MASTER branch  i.e. all the structure  of your Ankith/Feat2 branch  is different from initial setup then we can use rebase to place your branch commits on top of latest MASTER branch, creating cleaner linear history.&lt;/p&gt;

&lt;p&gt;Here we can resolve merge conflicts either automatically or manually.&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%2Fi85oi7fn54zqshzmrfn0.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%2Fi85oi7fn54zqshzmrfn0.png" alt=" " width="800" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can explore the above topics in a bit depth by using these commands and playing with them.&lt;/p&gt;

&lt;p&gt;Explore about how Pull Request is created in an org and in open source contributions, if possible add pull request to my repo  - &lt;a href="https://github.com/ANKITHDEEGOJU/Test_Repo" rel="noopener noreferrer"&gt;https://github.com/ANKITHDEEGOJU/Test_Repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If possible do create your open repo and configure it to allow PR”s from others by modifying the branch settings. [ Explore Protected Branches]&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A small clarity - if you are the owner of the repo then you have the permission to directly push changes to MASTER branch, else you can push code directly to your custom branch and then raise a PR [if admin of the repo provides you access to create your own branch]. Generally people fork the repo , create their individual branch in the local repo , then push code to the MASTER branch of this local repo, check if everything is fine. Then send PR to admin/ maintainer to accept the updates. Then the  maintainer verifies the code changes then accepts the pull request , merges changes into the main/MASTER branch of the repo.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Reference - &lt;a href="https://git-scm.com/cheat-sheet" rel="noopener noreferrer"&gt;Git Cheat Sheet&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Basics of Git -</title>
      <dc:creator>Ankith Deegoju</dc:creator>
      <pubDate>Fri, 20 Mar 2026 11:37:06 +0000</pubDate>
      <link>https://dev.to/ankith_deegoju_155982c916/basics-of-git--4af6</link>
      <guid>https://dev.to/ankith_deegoju_155982c916/basics-of-git--4af6</guid>
      <description>&lt;h2&gt;
  
  
  What is Git.
&lt;/h2&gt;

&lt;p&gt;Git is a version control system. Version Control System is a software that manages changes of your code/files in a folder/directory. &lt;/p&gt;

&lt;h3&gt;
  
  
  What is the problem its solving -
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Provides us tracking of changes in codebase.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Provides us simultaneous access to codebase enabling collaboration&lt;br&gt;
[ via GitHub -&amp;gt; Simply say git in a server || Even I need to deep dive into it ]&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Provides us a single source of truth i.e. provides us exact state of code base that is constantly being updated with changes done by members accessing the code base.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To understand it's importance and need of git.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario&lt;/strong&gt; - &lt;em&gt;Imagine how you would collaborate with other developers and build together a project.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;Suppose you have multiple people working with the same codebase but need simultaneous access and push changes independent of others in different parts of codebase. &lt;/p&gt;

&lt;p&gt;Era before git - By sharing code via pendrive.&lt;br&gt;
Think of use cases like - How can we provide simultaneous access and consistent updates of code across all developers of the code base.&lt;/p&gt;

&lt;p&gt;I would like to know about ideas which you can think of in the above context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How was git built&lt;/strong&gt; - [Just a short story]&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Linus Torvald&lt;/em&gt; was working on Linux. As it was open source project many developers pushed code to improvise it, eventually the code base was too big to track and update changes. To solve this issue git was developed as his side project.&lt;/p&gt;


&lt;h2&gt;
  
  
  How do we use git -
&lt;/h2&gt;

&lt;p&gt;[Start doing it in a system with me]&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a folder - LearningGit &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create two files - ex - demo1.txt , demo2.txt&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open your terminal and let's work in it now on.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Few basic commands -&lt;/p&gt;

&lt;p&gt;ls - to list files in a folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;              Linux/WSL         Command Prompt (cmd)
List Files   ls               dir

Detailed List   ls -l             dir

Show Hidden ls -a            dir /a

All Details ls -la               dir /a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;nano - Linux -&amp;gt; To create and edit files&lt;/p&gt;

&lt;p&gt;edit - Windows -&amp;gt; Installation Command - winget install Microsoft.Edit&lt;/p&gt;

&lt;p&gt;Usage:- &lt;code&gt;&amp;gt; edit &amp;lt;filename&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Key Bindings { Shortcut Keys } -&amp;gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ctrl+S to save.

Ctrl+F for find and replace.

Ctrl+Q to exit. 

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add some info into your files .&lt;/p&gt;

&lt;p&gt;cat - Linux -&amp;gt; To view file data&lt;/p&gt;

&lt;p&gt;type - Windows &lt;/p&gt;

&lt;p&gt;Usage - &lt;code&gt;type file.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Concatenate/Merge files: type file1.txt file2.txt &amp;gt; combined.txt&lt;/p&gt;

&lt;p&gt;Let's now start using our git commands .&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git init&lt;/code&gt; - Initializes git inside your folder with by creating a .git file.&lt;/p&gt;

&lt;p&gt;O/P =&amp;gt; Initialized empty Git repository in C:/WebDev/LearningGit/.git/&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git status&lt;/code&gt;- To check the status &lt;/p&gt;

&lt;p&gt;Red - Untracked&lt;br&gt;
Green - Files that are being tracked / staged to be tracked.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Staging&lt;/strong&gt; -&lt;/p&gt;

&lt;p&gt;We need to stage files that we wish to track. A way to tell git to look into these files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &amp;lt;filename&amp;gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; For individual file to be tracked

git add &lt;span class="nb"&gt;.&lt;/span&gt; -&amp;gt; For all files within the directory to be tracked.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Committing&lt;/strong&gt; - &lt;br&gt;
Once we are okay with changes we can commit the changes, we can store them as checkpoints for reference of changes or revert back in-case of any fallback. &lt;/p&gt;

&lt;p&gt;Command-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Initial files"&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Try to change the code a few times and try to commit.&lt;/p&gt;

&lt;p&gt;Once committed -&amp;gt; changes are permanently stored in .git file.&lt;/p&gt;

&lt;p&gt;How does it work.&lt;br&gt;
Under the hood we create a linked list of commits to file. Each new node stores a hash of prev node as a reference. As we have a head pointer in linked list similarly, we have a head pointer which points to the most updated node. &lt;/p&gt;

&lt;p&gt;We can perform git add and commit both in a single command. &lt;br&gt;
&lt;code&gt;git commit -am "msg"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git log&lt;/code&gt; - gives us history of commits performed.&lt;/p&gt;

&lt;p&gt;You get the list of commits with a unique hash value associated with each commit. &lt;/p&gt;

&lt;p&gt;We can compare changes form one commit to another using commands- &lt;/p&gt;

&lt;p&gt;&lt;code&gt;git diff &amp;lt;hashval of commit&amp;gt; &amp;lt;hashval of commit to be compared with&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;code&gt;git revert hash_id&lt;/code&gt;=&amp;gt; Creates a complement of the given hash_id and attaches head to it.&lt;/p&gt;

&lt;p&gt;The attached screenshot would be helpful.&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%2F5t7qdp8ylaipfx7o8f94.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%2F5t7qdp8ylaipfx7o8f94.png" alt="Under the hood working of git and basic commands" width="686" height="814"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will explore .git folder,git branching, GitHub concepts in the upcoming blogs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://git-scm.com/cheat-sheet" rel="noopener noreferrer"&gt;Git Cheat Sheet &lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
