<?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: Mosimi Akinlabi</title>
    <description>The latest articles on DEV Community by Mosimi Akinlabi (@mosimidev).</description>
    <link>https://dev.to/mosimidev</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%2F1151112%2Fce2d1163-ba6e-4ebd-bd89-0b7fbb122206.JPG</url>
      <title>DEV Community: Mosimi Akinlabi</title>
      <link>https://dev.to/mosimidev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mosimidev"/>
    <language>en</language>
    <item>
      <title>How to replace a single-page application with a different page in React Router</title>
      <dc:creator>Mosimi Akinlabi</dc:creator>
      <pubDate>Fri, 23 Feb 2024 20:16:32 +0000</pubDate>
      <link>https://dev.to/mosimidev/how-to-replace-a-single-page-application-with-a-different-page-in-react-router-2f84</link>
      <guid>https://dev.to/mosimidev/how-to-replace-a-single-page-application-with-a-different-page-in-react-router-2f84</guid>
      <description>&lt;p&gt;React Router is an npm package that enables you to construct dynamic routing in your web application, as Create React App(CRA) does not include page routing. This tutorial will walk you through changing your single-page application to another page, such as the one that registers new users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisite&lt;/strong&gt;&lt;br&gt;
You should have a basic understanding of React and Javascript to fully comprehend this tutorial. If you don’t, start by looking &lt;a href="https://react.dev/learn"&gt;here&lt;/a&gt; and &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Make sure you have react-router-dom installed from the node package manager at &lt;a href="https://www.npmjs.com/package/react-router-dom"&gt;nodejs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Folder Organisation&lt;/strong&gt;&lt;br&gt;
Assume for the purpose of this tutorial that you have a folder called screens that contains javascript files with the names Home, Overview, Timeline, FAQ (Frequently Asked Questions), Register screen, and then a Navbar.&lt;/p&gt;

&lt;p&gt;The screens are stacked on top of each other in App.js as a single-page application like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1yr8w2dkjzt0r1rewbp6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1yr8w2dkjzt0r1rewbp6.png" alt="code snippet from snappify" width="371" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Assuming that you want to replace all of the screens with the register screen when a user clicks on the register button in the navbar of your web application. The trick is to arrange all of the pages to sit on one page to make up the main page. Then you wrap it with &lt;code&gt;&amp;lt;Routes&amp;gt; &amp;lt;/Routes&amp;gt;&lt;/code&gt; like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp6g04weu71yz9ki9k9jl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp6g04weu71yz9ki9k9jl.png" alt="code snippet from snappify" width="512" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your home page should look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkz3jk885mk086lx3waz5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkz3jk885mk086lx3waz5.png" alt="code snippet from snappify" width="746" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, you go to your navbar.js to handle the logic of replacing the home screen with the register screen. Your navbar should look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkd1co5dxc1o7d7qewx2a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkd1co5dxc1o7d7qewx2a.png" alt="code snippet from snappify" width="617" height="670"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All of your screens should now be accessible from your navbar. You should also be able to replace your single-page application with the register screen when a user clicks on the register button.&lt;/p&gt;

</description>
      <category>react</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>HTTP Response Codes Cheatsheet: What do they even mean?</title>
      <dc:creator>Mosimi Akinlabi</dc:creator>
      <pubDate>Fri, 24 Nov 2023 01:15:05 +0000</pubDate>
      <link>https://dev.to/mosimidev/http-response-codes-cheatsheet-what-do-they-even-mean-cnh</link>
      <guid>https://dev.to/mosimidev/http-response-codes-cheatsheet-what-do-they-even-mean-cnh</guid>
      <description>&lt;p&gt;HTTP response status codes are used by servers to indicate when a specific HTTP request has been successful or if it has encountered some sort of error. &lt;/p&gt;

&lt;p&gt;Understanding status codes and how to utilise them can allow you to rapidly diagnose site faults and minimise downtime on your site. These status codes are the internet equivalent of a conversation between your browser and the server.&lt;/p&gt;

&lt;p&gt;Responses are grouped into five classes. The first digit of the status code defines the class of response, while the last two digits do not have any classifying or categorization role. The standard defines five classes:&lt;/p&gt;

&lt;p&gt;Informational Responses (100–199)&lt;br&gt;
Successful Responses (200–299)&lt;br&gt;
Redirection Messages (300–399)&lt;br&gt;
Client Error Responses (400–499)&lt;br&gt;
Server Error Responses (500–599)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Informational Responses&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An informational response indicates that the server received the request and is thinking through it. It is issued temporarily while the request processing continues. It alerts the client to wait for a final response.&lt;/p&gt;

&lt;p&gt;The message consists of the status line and optional header fields only and is terminated by an empty line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;100 Continue&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This status code indicates that the server has received the request headers, and the client should proceed to send the request body. That is in the case where a body needs to be sent, like a POST request. After a request is denied due to incorrect headers, it would be inefficient to send a large request body to the server.&lt;/p&gt;

&lt;p&gt;To have a server check the request's headers, a client must send &lt;code&gt;Expect: 100-continue&lt;/code&gt; as a header in its initial request and receive a &lt;code&gt;100 Continue&lt;/code&gt; status code in response before sending the body. The request’s body should not be sent if the client receives an error code of &lt;code&gt;403 (Forbidden)&lt;/code&gt;or &lt;code&gt;405 (Method Not Allowed)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A response of &lt;code&gt;417 Expectation Failed&lt;/code&gt; indicates that the request should be repeated without the Expect header, as it indicates that the server does not support expectations.&lt;/p&gt;

&lt;p&gt;This temporary response indicates that the client should continue the request or ignore the response if the request is already finished.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;101 Switching Protocols&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;In response to a client's upgrade request header, the server sends this status code, which specifies the protocol the server is moving to. This simply means the client has asked the server to switch protocols, and the server has agreed to do so.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;102 Processing&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This status code means that although the request has been received and is being processed by the server, a response is not yet available. By doing this, the client is kept from time out and thinking that the request was lost. This status code is deprecated.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;103 Early Hints&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This status code is used to return some response headers before the final HTTP message. It is primarily intended to be used with the _Link _header. It lets the user agent know to start preloading resources while the server prepares a response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Successful Responses&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A successful response indicates the request was successful and the browser got the expected response from the server. This class of status codes indicates the action requested by the client was received, understood, and accepted.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;200 OK&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This is an indication of a successful HTTP request. The response you get will depend on the request method used.&lt;/p&gt;

&lt;p&gt;In a GET request, the response will contain the resource that has been fetched and transmitted in the message body.&lt;/p&gt;

&lt;p&gt;In a POST request, the resource contains a description of the result of the action, which is transmitted through the message body.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;201 Created&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With this status code, it means a new resource has been created due to the request succeeding. This type of response is typical for a POST request, or some PUT requests.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;202 Accepted&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This status code means that the request has been accepted for processing but has not been completed. The request might eventually get acted upon or not and may be disallowed when processing occurs.&lt;/p&gt;

&lt;p&gt;This is because it is noncommittal since there is no way HTTP can send an asynchronous response indicating the outcome of the request. It is meant for cases where another server handles the request.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;203 Non-Authoritative Information&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This indicates that the server has received a  &lt;code&gt;200 OK&lt;/code&gt; from its origin but it is returning a modified version of the origin’s response.&lt;/p&gt;

&lt;p&gt;It is mostly used for backups or mirrors of another server.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;204 No Content&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This means that the server has received the request and processed it, but is not returning any content.&lt;/p&gt;

&lt;p&gt;The headers may be useful in this scenario.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;205 Reset Content&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This indicates that the user agent or user should reset the document that sent the request. No content is usually returned.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;206 Partial Content&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This response code indicates that the range header sent from the client has requested only part of a resource.&lt;/p&gt;

&lt;p&gt;The range of header is used by the client to enable resuming of interrupted downloads or split a download into multiple simultaneous streams.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;207 Multi-Status&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The message body from this request is usually an XML message. Such a body can contain multiple response codes and information about multiple resources, depending on how many sub-requests were made.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;226 IM Used&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;IM stands for Instance-Manipulation. This response code means a server has successfully processed a request for the resource.&lt;/p&gt;

&lt;p&gt;The response obtained is a representation of what happens when the current instance is subjected to one or more instance manipulations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Redirection Messages&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A redirection message is sent after you get redirected. It indicates that the request was received, but there was a redirect of some kind. This class of status code indicates that the client must take additional action to complete the request. &lt;/p&gt;

&lt;p&gt;The additional action may be carried out by the user agent with no user interaction only if the method used in the second request is GET or HEAD. The user agent may also redirect the request. The user agent should be able to detect and intervene to prevent cyclical redirects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;300 Multiple Choices&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This status code indicates that the request has more than one response. The user agent or user is prompted to choose one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;301 Moved Permanently&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This status code means that the URL of the requested resource has been changed permanently and all requests should be directed to the given URL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;302 Found &lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This response code means that the URL of the requested resource has been changed on a temporary basis and further changes may be made to the URL in the future. Therefore, the same URL should be used by the user agent or user in future requests.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;303 See Other&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;When the status code is displayed for a GET request, it usually indicates that the response can be found at another URL. When received in response to a POST or PUT or DELETE request, it indicates that the client should presume that the server has received the data and should send a GET request to the given URL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;304 Not Modified&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is meant for caching purposes. By caching, it means data is stored in temporary storage locations so it can be accessed faster. It also tells the user agent or user that the response has not been modified so the client can continue to use the same cached version of the response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;307 Temporary Redirect&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This response code means that the user agent or user should get the requested resource at another URL using the same HTTP method. That is, if a POST request is used in the original request, a POST request should be used in the second request. However, future requests should still use the original URL as it is on a temporary basis.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;308 Permanent Redirect&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This means that the resource has been relocated permanently to another URL. However, the same HTTP method should be used in the second request as the first one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Client Error Responses&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This class of status codes indicates that the site or page could not be reached. This simply means that the request was made but the page is not valid. This error is from the website’s side of the conversation and often appears when a page does not exist on the site.&lt;/p&gt;

&lt;p&gt;This class of status code is intended for situations in which the error seems to have been caused by the client. The message from the server should include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition except when it is responding to a HEAD request. Any request method can use these status codes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;400 Bad Request&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This status code indicates that the server cannot process the request due to client errors like malformed request syntax, invalid request message framing or deceptive request routing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;401 Unauthorised&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This response simply means "unauthenticated". That is, the client must authenticate itself to get the requested response. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource.&lt;/p&gt;

&lt;p&gt;Also, some sites incorrectly issue &lt;code&gt;HTTP 401&lt;/code&gt; when an IP address is banned from the website (usually the website domain) and that specific address is refused permission to access a website.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;402 Payment Required&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The main aim for creating this status code was to use it for digital payment systems, however, this status code is used very rarely and no standard convention exists.&lt;/p&gt;

&lt;p&gt;For example, Google Developers API uses this status code if a  developer has exceeded the daily limit on API requests.&lt;br&gt;
Sipgate uses this status code if an account does not have sufficient funds to start a call.&lt;/p&gt;

&lt;p&gt;Shopify uses this status code when the store has not paid its fees and has been temporarily disabled.&lt;/p&gt;

&lt;p&gt;Stripe uses this status code for failed payments where parameters were incorrect, like blocked fraudulent payments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;403 Forbidden &lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This status code means that the client does not have access rights to the content, that is, it is unauthorised, so the server is refusing to give the requested resource. Here, the request contained valid and correct data that was understood by the server but refused to take action.&lt;/p&gt;

&lt;p&gt;This may be a result of the user not having the necessary permissions for a resource, needing an account, or attempting a prohibited action like creating a duplicate record where only one is allowed.&lt;/p&gt;

&lt;p&gt;Authentication is usually refused by the server when this status code is returned. The request should not be repeated.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;404 Not Found&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;In an API, this status code means that the endpoint and request are valid but the resource itself does not exist. In a browser, it means the URL is not recognized.&lt;/p&gt;

&lt;p&gt;It is the most well-known status code because of its frequent occurrence on the web.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;405 Method Not Allowed&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here, this status code indicates that the request method is known by the server but is not supported by the target resource. For example, an API may not allow calling DELETE to remove a resource from its endpoint or a GET request on a form that requires data to be presented via POST.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;406 Not Acceptable&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This status code is sent when there is no content that matches the criteria given by the user agent. This simply means that the requested resource is only capable of generating unacceptable content for the headers in the request.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;407 Proxy Authentication Required &lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is similar to &lt;code&gt;401 unauthorised&lt;/code&gt; but authentication needs to be done by a proxy. Proxy here means a server application that acts as an intermediary between the client requesting a resource and the server providing the resource.&lt;/p&gt;

&lt;p&gt;The client must first authenticate itself with the proxy before the requested resource can be provided.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;408 Request Timeout&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This means that the client did not produce a request within the time that the server was prepared to wait and would like to shut down the idle connection. The client may repeat such requests without modifications at a later time.&lt;/p&gt;

&lt;p&gt;Also, note that some servers may shut down the connection without sending this message.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;409 Conflict&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This indicates that a conflict has occurred. When a request cannot be processed because of conflicts with the current state of the server, this status code is sent as a response.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;410 Gone&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This status code is sent when the requested content has been permanently removed from the server with no forwarding address. Upon receiving a &lt;code&gt;410&lt;/code&gt; status code, the client should not request the resource in the future as it is no longer available and will not be available again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;411 Length Required&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This status code indicates that the server rejected the request because the Content-Length header field is not defined and is required by the server.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;412 Precondition Failed&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This status code indicates that the client has indicated some preconditions in its headers that the server does not meet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;413 Payload Too Large&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here, the request load is larger than the limit allowed by the server. Hence, the server might close the connection or return a retry-after header field.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;414 URI Too Long&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;URI stands for Uniform Resource Identifier and they allow a client to identify a resource. For this status code, however, it is displayed when the URI requested by the client is longer than a server can process.&lt;/p&gt;

&lt;p&gt;It is often the result of too much data being encoded as a query string of a GET request, in which case it should be converted to a POST request.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;415 Unsupported Media Type&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This means that the server has rejected the request because the media format of the requested data is not in a  supported format.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;416 Range Not Satisfiable&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This status code indicates that the range specified in the range header field of the request is outside the size of the target URI’s data and the request cannot be fulfilled.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;417 Expectation Failed&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This response code means that the server cannot meet the expectation indicated by the expect request header field.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;421 Misdirected Request&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;You get this response when the request is directed at a server that is not able to produce a response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;422 Unprocessable Entity&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This response code means that the request was well-formed but was unable to be processed due to semantic errors. And by semantic error, it means that the program produces incorrect results when executed.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;423 Locked&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;You get this response when the resource being requested is locked.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;424 Failed Dependency&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This response code means that the request failed due to the failure of a previous request. &lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;425 Too Early&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This status code indicates that the server will not risk processing a request because it might be replayed.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;426 Upgrade Required&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This status code indicates that the server will not process the request using the current protocol but will do so after the client upgrades to a different protocol.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;428 Precondition Required&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This status code indicates that the server is trying to prevent a conflict. It requires the request to be conditional so as to prevent the lost update problem.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;429 Too Many Requests&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;You get this response when you have sent too many requests in a particular amount of time. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;431 Request Header Fields Too Large&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You get this response when the server won’t process the request because its header fields are too large. You may need to reduce the size of your request header field to get the server to process your request.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;451 Unavailable For Legal Reasons&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This status code indicates that the user requested a resource that is censored legally. The server operator has received a legal demand to deny access to such resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Server Error Responses&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This class of status codes indicate when a valid request was made by the client but the server failed to complete the request. A response status code of this kind indicates that the server is aware that it has encountered an error or is incapable of performing the request.&lt;/p&gt;

&lt;p&gt;The message from the server should include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition except when it is responding to a HEAD request. Any request method can use these status codes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;500 Internal Server Error&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You get this generic error message when the server has encountered a situation it does not know how to handle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;501 Not Implemented&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This usually means that the server does not recognize the request method and such request method is not supported therefore it cannot be handled.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;502 Bad Gateway&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This usually indicates that the server got an invalid response from the upstream server while working as a gateway to get the response needed to handle the request.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;503 Service Unavailable&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;This status code is sent as a response to indicate an error that is temporary. Here, the server is not yet ready to handle the request usually because the server is down for maintenance or is overloaded.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;504 Gateway Timeout&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This usually indicates that the server did not get a response in time while acting as a gateway from the upstream server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;505 HTTP Version Not Supported&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This means the server does not support the HTTP version used in the request.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;506 Variant Also Negotiates&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This means that the server has an internal configuration error where a transparent content negotiation for the request results in a circular reference.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;507 Insufficient Storage&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The request could not be completed because the server was unable to store the representation needed to successfully complete the request.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;508 Loop Detected&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This means an infinite loop was detected while processing the request.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;510 Not Extended&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This usually means that the server requires further extension to the request to fulfil it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;511 Network Authentication Required&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This indicates that the client needs to authenticate to gain network access.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Differentiate Between Put and Post Request In Rest API</title>
      <dc:creator>Mosimi Akinlabi</dc:creator>
      <pubDate>Mon, 06 Nov 2023 15:42:42 +0000</pubDate>
      <link>https://dev.to/mosimidev/how-to-differentiate-between-put-and-post-request-in-rest-api-505k</link>
      <guid>https://dev.to/mosimidev/how-to-differentiate-between-put-and-post-request-in-rest-api-505k</guid>
      <description>&lt;p&gt;I remember asking myself this question when I started learning API methods. You are not alone, as many developers struggle to tell the difference between the POST and PUT methods when building and designing a system.&lt;/p&gt;

&lt;p&gt;To understand this article better, it is important to understand the meaning of Rest API. REST (Representational State Transfer) is simply a style of software architecture. Easy! And, as described in a dissertation by Roy Fielding, REST is an “architectural style” that basically exploits the existing technology and protocols of the Web. &lt;br&gt;
While Restful API is typically used to refer to web services implementing such “architectural style” (REST).&lt;/p&gt;

&lt;p&gt;Now that the concept of REST API is clear, RESTful web services use HTTP methods to communicate with clients. The HTTP method used by the client will determine how the server will respond to the request. The PUT and POST are examples of HTTP methods used in RESTful web services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Difference&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The PUT method is used to update an existing resource, while the POST method is used to create a new resource. What this simply means is that PUT is used for updates to existing data, while POST creates a new object for new data to be created.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How It Works&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When the POST method is used to create a resource on the server, the resource is created as a subordinate resource to the URL that the POST method provides. For example, in a flight tracking system where users look up the status of an “American Airlines flight”, the URL will look like this:&lt;br&gt;
&lt;code&gt;www.example.com/flights/AA123&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The PUT method, on the other hand, requires the exact URL of the resource to be updated. For example, to update the status of the flight, the PUT operation includes a JSON or XML payload to describe the new status.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PUT URL: www.example.com/flights/AA123
PAYLOAD: {"status": "ontime", "gate": "b12"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is a common occurrence in database-based applications that the exact URL of the resource is not known. The newly created resource is identifiable by a value that gets generated after the resource’s data is recorded.&lt;/p&gt;

&lt;p&gt;An example of such an occurrence is a primary key-based identifier. If you need to create a resource that is subordinate to the URL provided, you should use a POST method, not a PUT method.&lt;/p&gt;

&lt;p&gt;When you use the POST method, all the information needed to create a new resource is provided as JSON or XML in the request’s payload. REST demands that the new URL created be sent back to the calling program as a location header. This allows the calling program to use the PUT method for future updates.&lt;/p&gt;

&lt;p&gt;This is why the difference between a PUT and POST method is often phrased as; to create an object, use a POST, while the PUT method should be used for updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Idempotence&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Idempotent means that a certain operation can be applied many times without the result changing. &lt;/p&gt;

&lt;p&gt;PUT is idempotent, while POST is not idempotent. This simply implies that when you use the PUT method to call "create user” multiple times, you should still get one user as long as the value is the same. Multiple identical PUT requests will have the same effect as a single request.&lt;/p&gt;

&lt;p&gt;In contrast, for POST requests, new records get created when duplicate data is sent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Status Code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In a POST request, a new record gets created for each request, HTTP &lt;code&gt;201&lt;/code&gt; is sent in response when this is done, and HTTP &lt;code&gt;409&lt;/code&gt; if duplicates are not allowed. HTTP &lt;code&gt;200&lt;/code&gt; is sent when the record gets updated, and HTTP &lt;code&gt;201&lt;/code&gt; if the record is new.&lt;/p&gt;

&lt;p&gt;For a PUT request, the server sends a &lt;code&gt;200 (OK)&lt;/code&gt; or a &lt;code&gt;204 (No Content)&lt;/code&gt; response to indicate successful completion of the request if there is no current representation of the data on the server.  HTTP &lt;code&gt;201&lt;/code&gt; will be sent if a new resource is created.&lt;/p&gt;

&lt;p&gt;Lastly, in this tutorial, you learned about REST and RESTful web services. You have looked at what distinguishes a PUT request from a POST request, their respective idempotency, and what response a server sends when any of them is executed.&lt;/p&gt;

</description>
      <category>api</category>
      <category>restapi</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Git Commands: The Ultimate Cheatsheet</title>
      <dc:creator>Mosimi Akinlabi</dc:creator>
      <pubDate>Sat, 14 Oct 2023 15:02:03 +0000</pubDate>
      <link>https://dev.to/mosimidev/git-commands-the-ultimate-cheatsheet-41j2</link>
      <guid>https://dev.to/mosimidev/git-commands-the-ultimate-cheatsheet-41j2</guid>
      <description>&lt;p&gt;Git is a version control system in software development that mirrors a codebase, including its full history, on every developer's computer. &lt;/p&gt;

&lt;p&gt;This is referred to as a distributed version control system. It is very important in software development because it is used to track changes in a set of computer files and to coordinate work among programmers who are working collaboratively on a source code to achieve a specific goal.&lt;/p&gt;

&lt;p&gt;This cheat sheet contains commonly used and important Git commands for easy reference.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;You should have git installed on your computer, depending on the operating system of your machine(Windows, Linux or Mac). This should be done either through the command line or Git’s website. For more information on the step-by-step guide for installation, check here. Are you finished? Let’s proceed.&lt;/p&gt;

&lt;h4&gt;
  
  
  Getting and Creating Projects
&lt;/h4&gt;

&lt;p&gt;Use the following commands to create a new Git repository or a copy of an existing one.&lt;/p&gt;

&lt;p&gt;(a) &lt;code&gt;git init&lt;/code&gt; &lt;br&gt;
This is the first command you must learn if you want to keep your project under revision control. It's also worth noting that running this command in an existing project or repository is safe and will not overwrite any existing files. When you run this command, it will generate an empty Git repository.&lt;/p&gt;

&lt;p&gt;(b) &lt;code&gt;git clone&lt;/code&gt;&lt;br&gt;
Cloning a repository is the process by which developers obtain a working copy of a main repository, making it easier to track changes and assign tasks to team members. When you clone a repository, it creates a local copy of the main repository on your machine.&lt;/p&gt;

&lt;h4&gt;
  
  
  Snapshotting
&lt;/h4&gt;

&lt;p&gt;A snapshot is a copy of your project at a specific point in time. Assume you make backups by copying your entire project, zipping it, and adding a label and timestamp. That is a snapshot. Use the following commands to make a snapshot:&lt;/p&gt;

&lt;p&gt;(a) &lt;code&gt;git add[file-name.txt]&lt;/code&gt;&lt;br&gt;
Before committing to the main repository, you can use this command to create a snapshot of your local repository. It is important to note that before running the commit command, you must add any new or modified files to the index using the add command.&lt;/p&gt;

&lt;p&gt;(b)  &lt;code&gt;git add-A&lt;/code&gt;&lt;br&gt;
 This command adds to the staging area all new and changed files in the entire working tree.&lt;/p&gt;

&lt;p&gt;(c)  &lt;code&gt;git status&lt;/code&gt;&lt;br&gt;
This command should be used in conjunction with &lt;em&gt;git add&lt;/em&gt; and &lt;em&gt;git commit&lt;/em&gt; to see what will be included in the next snapshot. This command displays the working directory state as well as the staged snapshot.&lt;/p&gt;

&lt;p&gt;(d)  &lt;code&gt;git diff&lt;/code&gt;&lt;br&gt;
You can infer what a command does from its name, as you can with most git commands. &lt;em&gt;Git diff&lt;/em&gt; displays the differences between commits, commits, and working trees.&lt;/p&gt;

&lt;p&gt;(e) &lt;code&gt;git commit&lt;/code&gt;&lt;br&gt;
This command logs changes to the repository. It saves the staged snapshot of the project's history. When combined with git add, it depicts the day-to-day workflow of git users.&lt;/p&gt;

&lt;p&gt;(f) &lt;code&gt;git notes&lt;/code&gt;&lt;br&gt;
This command is used to add, remove, or read notes attached to objects without having to touch the objects. &lt;em&gt;Git notes&lt;/em&gt; are commonly used to supplement a commit message without altering the commit itself.&lt;/p&gt;

&lt;p&gt;(g) &lt;code&gt;git restore&lt;/code&gt;&lt;br&gt;
 This command restores working tree files. Another application for this command is to restore specified paths in the working tree with some content from a restore source. &lt;em&gt;IT IS IMPORTANT TO NOTE THAT THIS COMMAND IS EXPERIMENTAL AND THE BEHAVIOR MAY CHANGE&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;(h) &lt;code&gt;git reset&lt;/code&gt;&lt;br&gt;
This command returns the current HEAD to its original state. This means that it reverses changes made to files in the working directory. It can be used to clean up or remove changes that have not been pushed to a public repository.&lt;/p&gt;

&lt;p&gt;(i) &lt;code&gt;git rm&lt;/code&gt;&lt;br&gt;
 This command deletes files from the working directory.&lt;/p&gt;

&lt;p&gt;(j) &lt;code&gt;git mv&lt;/code&gt;&lt;br&gt;
This command is used to move or rename a file or directory.&lt;/p&gt;

&lt;h4&gt;
  
  
  Branching and Merging
&lt;/h4&gt;

&lt;p&gt;Branching and merging refers to the process of making a separate copy of a main codebase to incorporate a local change to it. Use the following commands to achieve this:&lt;/p&gt;

&lt;p&gt;(a) &lt;code&gt;git branch&lt;/code&gt; &lt;br&gt;
This command can be used to list branches as well as create and delete them. It is simply a general-purpose branch administration tool. It allows for the creation of isolated development environments within a single repository. This is done to make it easier to track changes to the repository and assign tasks to team members.&lt;/p&gt;

&lt;p&gt;(b) &lt;code&gt;git branch -a&lt;/code&gt; &lt;br&gt;
This returns a list of all branches, whether local or remote.&lt;/p&gt;

&lt;p&gt;(c) &lt;code&gt;git branch [branch name]&lt;/code&gt;&lt;br&gt;
This command is used to start a new branch.&lt;/p&gt;

&lt;p&gt;(d) &lt;code&gt;git branch -d [branch name]&lt;/code&gt;&lt;br&gt;
This is used to remove a branch.&lt;/p&gt;

&lt;p&gt;(e) &lt;code&gt;git branch-m [old branch name][new branch name]&lt;/code&gt;&lt;br&gt;
This is used to rename a local branch.&lt;/p&gt;

&lt;p&gt;(f) &lt;code&gt;git checkout&lt;/code&gt;&lt;br&gt;
This command allows you to switch branches or restore working tree files. It can also be used to navigate existing branches and check out old commits and file revisions.&lt;/p&gt;

&lt;p&gt;(g) &lt;code&gt;git checkout-b [branch name]&lt;/code&gt;&lt;br&gt;
 This is used to create and switch to a new branch.&lt;/p&gt;

&lt;p&gt;(h) &lt;code&gt;git checkout-b [branch name] origin/[branch name]&lt;/code&gt;&lt;br&gt;
This clones and switches to a remote branch.&lt;/p&gt;

&lt;p&gt;(i) &lt;code&gt;git checkout [branch name]&lt;/code&gt;&lt;br&gt;
This command switches to a branch.&lt;/p&gt;

&lt;p&gt;(j) &lt;code&gt;git switch&lt;/code&gt;&lt;br&gt;
This command is used to navigate between branches. When this command is executed, the working tree is updated to match the branch. &lt;em&gt;IT IS IMPORTANT TO NOTE THAT THIS COMMAND IS EXPERIMENTAL AND THE BEHAVIOR MAY CHANGE&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;(k) &lt;code&gt;git merge&lt;/code&gt;&lt;br&gt;
This is used to link two or more development histories together.&lt;/p&gt;

&lt;p&gt;(l) &lt;code&gt;git merge tool&lt;/code&gt; &lt;br&gt;
To resolve merge conflicts, use this command to run merge conflict resolution tools. It is typically executed following a git merge.&lt;/p&gt;

&lt;p&gt;(m) &lt;code&gt;git log&lt;/code&gt; &lt;br&gt;
This displays commit logs.&lt;/p&gt;

&lt;p&gt;(n) &lt;code&gt;git stash&lt;/code&gt;&lt;br&gt;
When you want to record the current state of the working directory but return to a clean working directory, use this command. That is, it saves your local changes while reverting the working directory to the main commit.&lt;/p&gt;

&lt;p&gt;(o) &lt;code&gt;git worktree&lt;/code&gt;&lt;br&gt;
This command is used to manage multiple working trees attached to the same repository. Some of them include: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;git worktree add&lt;/code&gt;&lt;br&gt;
This command associates a new working tree with the repository and adds extra metadata to it. A work tree is distinguished from others in the same repository in this manner.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;git worktree list&lt;/code&gt;&lt;br&gt;
This command displays information about each worktree. The main worktree appears first, followed by any linked worktrees.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;git worktree lock&lt;/code&gt;&lt;br&gt;
This command prevents files from being pruned, moved, or deleted automatically.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;git worktree move&lt;/code&gt;&lt;br&gt;
This command is used to relocate a worktree.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;git worktree prune&lt;/code&gt;&lt;br&gt;
This command prunes worktree data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;git worktree remove&lt;/code&gt;&lt;br&gt;
This command is used to delete clean worktrees that contain no untracked files and no modified tracked files. Unclean worktrees should be removed with &lt;code&gt;--force&lt;/code&gt;. It should be noted that the main worktree cannot be removed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;git worktree repair&lt;/code&gt;&lt;br&gt;
This command repairs worktree files that have been moved or corrupted as a result of external factors.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;git worktree unlock&lt;/code&gt; &lt;br&gt;
This command allows you to prune, move, or delete a worktree.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Sharing and Updating Projects
&lt;/h4&gt;

&lt;p&gt;Use the following commands to share a local change and update it in the main codebase:&lt;/p&gt;

&lt;p&gt;(a) &lt;code&gt;git fetch&lt;/code&gt;&lt;br&gt;
This command is used to retrieve or download objects and references from a different repository. _git fetch _can retrieve files from a single repository or a URL.&lt;/p&gt;

&lt;p&gt;(b) &lt;code&gt;git pull&lt;/code&gt;&lt;br&gt;
This command fetches from the main repository and integrates it with another repository or a local branch. It merges changes from your local machine repository into the current branch.&lt;/p&gt;

&lt;p&gt;(c) &lt;code&gt;git push&lt;/code&gt;&lt;br&gt;
This command uses local refs to update remote or main refs while sending objects required to complete the local ref.&lt;/p&gt;

&lt;p&gt;(d) &lt;code&gt;git remote&lt;/code&gt;&lt;br&gt;
You can manage the set of repositories whose branches you track with this command.&lt;/p&gt;

&lt;p&gt;(e) &lt;code&gt;git submodule&lt;/code&gt;&lt;br&gt;
This command allows you to inspect, update, or initialise submodules. Submodules are repositories that are contained within another repository. Although such submodules have a history, the repository in which they are embedded is referred to as a super project.&lt;/p&gt;

&lt;h4&gt;
  
  
  Inspection and Comparison
&lt;/h4&gt;

&lt;p&gt;Use the following command to inspect a codebase's workflow and compare it to other developers' code:&lt;/p&gt;

&lt;p&gt;(a) &lt;code&gt;git show&lt;/code&gt;&lt;br&gt;
This command displays one or more objects (blobs, trees, tags, and commits) in a single repository.&lt;/p&gt;

&lt;p&gt;(b) &lt;code&gt;git log&lt;/code&gt;&lt;br&gt;
This command displays commit logs.&lt;/p&gt;

&lt;p&gt;(c) &lt;code&gt;git difftool&lt;/code&gt;&lt;br&gt;
This git command allows you to edit and compare them between revisions using common diff tools. &lt;em&gt;Git difftool&lt;/em&gt; is a GUI for git diff. It accepts the same options and arguments.&lt;/p&gt;

&lt;p&gt;(d) &lt;code&gt;git range-diff&lt;/code&gt;&lt;br&gt;
This git command compares two branches and displays the differences.&lt;/p&gt;

&lt;p&gt;(e) &lt;code&gt;git shortlog&lt;/code&gt;&lt;br&gt;
This git command summarises &lt;em&gt;git log&lt;/em&gt; output so that it can be included in release notes and announcements.&lt;/p&gt;

&lt;p&gt;(f) &lt;code&gt;git describe&lt;/code&gt;&lt;br&gt;
This command assigns a human-readable name to an object based on the available ref.&lt;/p&gt;

&lt;h4&gt;
  
  
  Patching
&lt;/h4&gt;

&lt;p&gt;Patching is used to distribute changes to others without pushing them to the repository's main branch to make necessary corrections. Use the following commands to achieve this:&lt;/p&gt;

&lt;p&gt;(a) &lt;code&gt;git apply&lt;/code&gt;&lt;br&gt;
This command applies a patch (diff output supplied) to files or the index.&lt;/p&gt;

&lt;p&gt;(b) &lt;code&gt;git cherry-pick&lt;/code&gt;&lt;br&gt;
This command applies the changes made by previous commits. This command requires a clean working tree.&lt;/p&gt;

&lt;p&gt;(c) &lt;code&gt;git rebase&lt;/code&gt; &lt;br&gt;
This git command allows you to move branches around to avoid unnecessary merge commits. It generates a linear history that is simple to comprehend and explore.&lt;/p&gt;

&lt;p&gt;(d) &lt;code&gt;git revert&lt;/code&gt;&lt;br&gt;
This command undoes some previous commits. Simply put, it restores a working tree to its previous state before a commit as if it never happened.&lt;/p&gt;

&lt;h4&gt;
  
  
  Debugging
&lt;/h4&gt;

&lt;p&gt;Debugging allows you to search through your commit history to identify when a “bad commit” occurred. Use the following commands to achieve this:&lt;/p&gt;

&lt;p&gt;(a) &lt;code&gt;git bisect&lt;/code&gt;&lt;br&gt;
This command comes in handy when you're looking for a commit that broke a feature in your project. To find the commit, it employs a binary search algorithm.&lt;/p&gt;

&lt;p&gt;(b) &lt;code&gt;git blame&lt;/code&gt;&lt;br&gt;
This command displays which author and revision modified each line of a file the most recently.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>git</category>
    </item>
  </channel>
</rss>
