<?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:  Suryadipta Ghosh</title>
    <description>The latest articles on DEV Community by  Suryadipta Ghosh (@sxryadipta).</description>
    <link>https://dev.to/sxryadipta</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%2F1722064%2F954f8e45-550f-4314-9b8d-371730465b86.png</url>
      <title>DEV Community:  Suryadipta Ghosh</title>
      <link>https://dev.to/sxryadipta</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sxryadipta"/>
    <language>en</language>
    <item>
      <title>Here's why you need a chess stats card</title>
      <dc:creator> Suryadipta Ghosh</dc:creator>
      <pubDate>Fri, 12 Jun 2026 10:34:03 +0000</pubDate>
      <link>https://dev.to/sxryadipta/heres-why-you-need-a-chess-stats-card-4pml</link>
      <guid>https://dev.to/sxryadipta/heres-why-you-need-a-chess-stats-card-4pml</guid>
      <description>&lt;p&gt;&lt;em&gt;How I spent a day automating something that takes 10 seconds to do manually, and why you should absolutely use it.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Let me paint you a picture.&lt;/p&gt;

&lt;p&gt;You're a developer. You open a developer's GitHub profile. There's a nice README: some skills, a few projects, maybe a visitor counter they definitely copied from Stack Overflow.&lt;/p&gt;

&lt;p&gt;Then you see it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Won as Black against a 1542-rated opponent. Sicilian Defense. 38 moves. Currently on a 5-game win streak."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You don't even play chess. You have no idea what any of that means. But you understand one thing. This person has a &lt;em&gt;personality&lt;/em&gt; besides coding. This person &lt;em&gt;ships things&lt;/em&gt;. This person spent their weekend building an automated README updater instead of touching grass.&lt;/p&gt;




&lt;h2&gt;
  
  
  Here's why you need a chess stats card on your GitHub profile
&lt;/h2&gt;

&lt;p&gt;You don't.&lt;/p&gt;

&lt;p&gt;Let's be honest; you absolutely do not need this. Your README was fine. Your projects speak for themselves. Nobody hiring you as a backend engineer cares that you blundered a rook on move 23.&lt;/p&gt;

&lt;p&gt;But here's the thing about developer profiles in 2026: everyone has the same README. Skills section. Projects section. GitHub stats card showing 847 contributions in green squares. A wavy SVG banner someone generated at readme.so.&lt;/p&gt;

&lt;p&gt;Chess stats? Nobody has that. And the ones who do are immediately more interesting than the ones who don't.&lt;/p&gt;

&lt;p&gt;That's the whole pitch. That's the blog post. &lt;/p&gt;

&lt;p&gt;Lemme tell you more about it since you seem interested.&lt;/p&gt;




&lt;h2&gt;
  
  
  The origin story (it's embarrassing)
&lt;/h2&gt;

&lt;p&gt;I was procrastinating.&lt;/p&gt;

&lt;p&gt;I had actual work to do real features, real projects. Instead I was playing Blitz on Chess.com at 1am, losing to some 500 rated, and thinking: &lt;em&gt;"I wish my GitHub profile knew about this loss so it could share in my suffering."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That thought, which a normal person would have dismissed immediately, lodged itself in my brain.&lt;/p&gt;

&lt;p&gt;By 2am I had an API route. By 3am I had a GitHub Action. By 4am I had deployed it to Vercel, watched it fail, fixed the UTF-8 encoding issue that was turning chess pieces into hieroglyphics, and gone to sleep feeling like I had accomplished something meaningful.&lt;/p&gt;

&lt;p&gt;I had not accomplished something meaningful. But I had built something cool.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I actually built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;chess-readme-stats&lt;/strong&gt; does two things:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Story mode&lt;/strong&gt; — a narrative text block that lives in your README and auto-updates every 6 hours via GitHub Actions. It reads your Chess.com games, figures out what happened, and writes a little story about it.&lt;/p&gt;

&lt;p&gt;It looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2026-06-10 · Blitz (3 min) · Playing as White

Opponent resigned after 38 moves

Opening: Sicilian Defense · ECO B20
Accuracy: 91.2%

Opponent: johndoe · 1542 rated (55 points above you)

Rating: 1487 → 1495 (+8)
Streak: 5-game win streak
This month: 21W 9L 3D (Blitz)

Peak hours: evenings
Personal best: 1623
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not a table. Not a JSON dump. A story. Because your games are stories and they deserve to be told.&lt;br&gt;
(I know it svcks in visual appeal, we gon fix that).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Card mode&lt;/strong&gt; — a single SVG image you embed in one line. No GitHub Actions. No workflow. No setup. Just:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="p"&gt;![&lt;/span&gt;&lt;span class="nv"&gt;Chess Stats&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;https://chess-readme-stats.vercel.app/api/card/yourusername.svg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Done. It shows your rating, peak rating, win rate, total games, country, and most played opening. Updates on every page load.&lt;/p&gt;




&lt;h2&gt;
  
  
  The technical bit (for the nerds)
&lt;/h2&gt;

&lt;p&gt;The whole thing runs on Next.js deployed to Vercel. Here's why those two choices specifically:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next.js&lt;/strong&gt; gives you API routes and a frontend in one project. My &lt;code&gt;/api/story/[username]&lt;/code&gt; and &lt;code&gt;/api/card/[username].svg&lt;/code&gt; endpoints live right next to the website that generates the setup instructions. One codebase, One deploy. One &lt;code&gt;git push&lt;/code&gt; and everything is live.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vercel&lt;/strong&gt; gives you edge deployment for free. This matters specifically for the SVG card — when GitHub renders someone's README, it hits your card endpoint from wherever their CDN node is closest to. Vercel's global network means that request is fast regardless of where the viewer is. A basic Express server on a single DigitalOcean droplet would be slower and more expensive.&lt;/p&gt;

&lt;p&gt;The Chess.com API is entirely public and requires zero authentication. You can hit it right now in your browser:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;https://api.chess.com/pub/player/hikaru/stats
https://api.chess.com/pub/player/hikaru/games/2026/06
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything I needed was sitting there. Ratings, game history, PGN strings with opening data baked in, accuracy scores when available, timestamps, country. No API key. No rate limit I hit in practice. Chess.com just... gives you this data. Genuinely one of the nicest public APIs I've worked with.&lt;/p&gt;

&lt;p&gt;The trickiest part was the opening name. Chess.com's PGN has an &lt;code&gt;[ECOUrl]&lt;/code&gt; header that looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;https://www.chess.com/openings/Sicilian-Defense-Dragon-Variation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You slug-parse that URL, replace hyphens with spaces, handle the &lt;code&gt;...&lt;/code&gt; notation for Black's variations, and you have a clean opening name. Much more reliable than the &lt;code&gt;[Opening]&lt;/code&gt; header which only appears sometimes.&lt;/p&gt;

&lt;p&gt;The second trickiest part was the streak calculation. A chess player plays Blitz, Rapid, and Bullet all mixed together in one games array. If I walked backwards counting consecutive wins, a Rapid loss would break a Blitz win streak incorrectly. The fix is filtering by &lt;code&gt;time_class&lt;/code&gt; before counting — only count streaks within the same format as the last game played.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to set it up in 2 minutes
&lt;/h2&gt;

&lt;p&gt;Go to &lt;strong&gt;&lt;a href="https://chess-readme-stats.vercel.app" rel="noopener noreferrer"&gt;chess-readme-stats.vercel.app&lt;/a&gt;&lt;/strong&gt;, enter your Chess.com username, and the site generates everything for you — a live preview of your card, the one-line embed, and the complete workflow YAML with your username already filled in.&lt;/p&gt;

&lt;p&gt;For card mode: copy one line, paste into README, done.&lt;/p&gt;

&lt;p&gt;For story mode: paste the token comments into your README, create one workflow file, run it once manually. After that it runs itself. Don't worry, as of writing this, I need the project is too pre-stage, but I'll maintain it &lt;/p&gt;

&lt;p&gt;The whole setup takes less time than the average chess game.&lt;/p&gt;




&lt;h2&gt;
  
  
  Contribute
&lt;/h2&gt;

&lt;p&gt;This is open source and I genuinely want contributors. There are real features missing that I haven't built yet:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Light mode card theme&lt;/li&gt;
&lt;li&gt;More custom card themes&lt;/li&gt;
&lt;li&gt;Blitz and Bullet rating variants (currently only Rapid)&lt;/li&gt;
&lt;li&gt;Rating history sparkline inside the card&lt;/li&gt;
&lt;li&gt;Lichess support for the non-Chess.com crowd&lt;/li&gt;
&lt;li&gt;Country code to full country name (right now it shows &lt;code&gt;IN&lt;/code&gt; not &lt;code&gt;India&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Response caching so we're not hammering Chess.com on every request&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If any of those sound interesting, the codebase is small — under 400 lines total across two route files and one page. You can read the whole thing in 20 minutes and ship something real.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/sxryadipta/chess-readme-stats" rel="noopener noreferrer"&gt;github.com/sxryadipta/chess-readme-stats&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The real reason I built this
&lt;/h2&gt;

&lt;p&gt;I'm a fresher. I'm building my portfolio. I needed projects that weren't todo apps or weather apps or Netflix clones.&lt;/p&gt;

&lt;p&gt;This is a real product with a real API, a real deployment, real users, and a real open source presence. I learned Next.js by building it. I learned API design by building it. I learned why cache headers matter by being burned by them at midnight.&lt;/p&gt;

&lt;p&gt;That's worth more than any tutorial. More importantly, that was something I cared about; and wished it existed&lt;/p&gt;

&lt;p&gt;Also my Chess.com stats are now on my GitHub profile and I feel 15% more legitimate as a person.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built with Next.js, deployed on Vercel, powered by the Chess.com public API.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If this was useful, a star on the repo means a lot — &lt;a href="https://github.com/sxryadipta/chess-readme-stats" rel="noopener noreferrer"&gt;github.com/sxryadipta/chess-readme-stats&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>chess</category>
      <category>github</category>
      <category>githubactions</category>
      <category>opensource</category>
    </item>
    <item>
      <title>I made a WhatsApp reminder for important FIFA World Cup matches.</title>
      <dc:creator> Suryadipta Ghosh</dc:creator>
      <pubDate>Fri, 05 Jun 2026 16:16:37 +0000</pubDate>
      <link>https://dev.to/sxryadipta/i-made-a-whatsapp-reminder-for-important-fifa-world-cup-matches-1al1</link>
      <guid>https://dev.to/sxryadipta/i-made-a-whatsapp-reminder-for-important-fifa-world-cup-matches-1al1</guid>
      <description>&lt;p&gt;I have been a busy these vacation days with my personal projects. But being a football fan, I can’t afford to miss World Cup matches. Especially of the big names. It is the last World Cup of the players of my generation; who I grew up watching. It is the last dance of the stars who got me hooked: Ronaldo, Messi, Neymar, Modric, Neuer, and more. And for this reason, I don’t want to miss the major matches in group stages and knockout rounds.&lt;/p&gt;

&lt;p&gt;I decided to make a simple WhatsApp reminder for me so that I have notifications of matches I want to watch without manually searching it up or missing out later. The teams I added are Brazil, Germany, Spain, France, Argentina, England and my favourite, Portugal.&lt;/p&gt;

&lt;p&gt;For this, I needed 4 things. Firstly, a data of the matches and their dates and timings. Secondly, an execution engine, which checks for the timings and triggers the alerts. Then, a delivery channel is needed. Lastly, an automation which acts as a scheduler and runs periodically.&lt;br&gt;
So for this, The first step was to create a &lt;code&gt;matches.json&lt;/code&gt; to store the match timings in Indian Standard Time (IST). &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%2Fnmornxj65m7op0h7da3i.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%2Fnmornxj65m7op0h7da3i.png" alt="Fig: Storing match data in matches.json" width="665" height="309"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I didn’t want to complicate it by fetching data, so I hardcoded it. Next, I needed to figure out a way to actually go through this JSON and add a WhatsApp reminder for me. I got to know about the Twilio WhatsApp sandbox, which is a pre-configured environment for sending business initiated messages. I can use that to send my scheduled reminders.&lt;br&gt;
I signed up for a Twilio account. After verification and filling preferences, I setup the Twilio WhatsApp sandbox. To begin testing, I connected to Twilio sandbox by sending a WhatsApp message from my device to the Twilio number (which was my own number). Twilio on a trial account lets you send messages to verified mobile numbers only. You need to get your Account SID and Auth token in order to run an automated script.&lt;br&gt;
Now, we need a script to parse the JSON file and send reminders at predetermined intervals. I needed reminders at 12, 3 and 1 hour before the match. Since the script runs every hour, it won’t land exactly at the 12h/3h/1h mark. So I give it a ±30 min buffer. Which means: If a match is between 690–750 mins away, it counts as the 12h reminder. The time is calculated by a &lt;code&gt;parseIST&lt;/code&gt; function which converts the &lt;code&gt;"2026-06-17 22:30"&lt;/code&gt; string into a proper JS Date object. It appends &lt;code&gt;+05:30&lt;/code&gt; so JS knows it's IST and converts it to UTC internally. A &lt;code&gt;minsToGo&lt;/code&gt; is set which calculates how many minutes from right now until kickoff. If it's negative, the match has already started. Now, we can loop over using this constant. For each match, it checks if the kickoff is within ±30 mins of the 12h, 3h, or 1h reminder window; and if so, builds and sends a WhatsApp message with the match details.&lt;br&gt;
I tested it locally by running it on node. And it worked! (had to alter the times of some matches temporarily to trigger the scheduled times)&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%2F39b08qmkfk0hjgsf9g68.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%2F39b08qmkfk0hjgsf9g68.png" alt="Fig: Snapshot of the reminder working properly." width="663" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To automate the running of this file, I added GitHub workflows. Firstly, setting up the Account SID, Auth Token and WhatsApp number in your repository secrets is required.&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%2Fztt9rvm7apjq13vni8in.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%2Fztt9rvm7apjq13vni8in.png" alt="Fig: A snapshot of the GitHub Repository secrets page." width="800" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then we create a &lt;code&gt;remind.yml&lt;/code&gt; file in the Github Workflow directory of the repository. It sets up a scheduler which runs every hour (you can manually run it too in repository actions). And all set! This now gives me periodic reminders of the upcoming important messages on WhatsApp.&lt;/p&gt;

&lt;p&gt;You can check the repository here: &lt;a href="https://github.com/sxryadipta/worldcup-match-reminder" rel="noopener noreferrer"&gt;https://github.com/sxryadipta/worldcup-match-reminder&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>github</category>
      <category>automation</category>
    </item>
    <item>
      <title>JS HTML DOM</title>
      <dc:creator> Suryadipta Ghosh</dc:creator>
      <pubDate>Sun, 13 Apr 2025 17:42:34 +0000</pubDate>
      <link>https://dev.to/sxryadipta/js-html-dom-43k9</link>
      <guid>https://dev.to/sxryadipta/js-html-dom-43k9</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The basic HTML and CSS teaches you to build static web pages. What I mean by static is, any change requires reloading the whole page. Developers would have to sit and wait all day to handle user interactions and update content on the fly- which is manually impossible. To create these dynamic experiences smoothly, the DOM was introduced.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is DOM?
&lt;/h2&gt;

&lt;p&gt;DOM stands for document object model. It was introduced as a structured representation of the HTML document. HTML elements are constructed as a tree of &lt;strong&gt;Objects&lt;/strong&gt; in HTML DOM. In the DOM, all HTML elements are defined as &lt;strong&gt;objects&lt;/strong&gt;. Using JavaScript we can create, delete or update these DOM elements in real-time, basically adding interactivity.&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%2Fi1j4v21elkncp1b36ipo.gif" 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%2Fi1j4v21elkncp1b36ipo.gif" alt="HTML DOM tree of objects in visual graph" width="486" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  DOM Document
&lt;/h2&gt;

&lt;p&gt;Think of HTML DOM document as the big object- the owner of all other objects in your web page. As he’s the owner, you need to go through him to get to his other owned objects. In other words, before accessing any other object, you access the document object first. Now, how do you access or manipulate objects/elements of your HTML web page?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.getElementById(id)  //find an element by element id.
element.innerHTML =  new html content  //change the inner HTML.
document.createElement(element)  //create new element.
document.removeChild(element)  //delete an element.
document.appendChild(element)  //add an element.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  DOM Methods and Properties
&lt;/h2&gt;

&lt;p&gt;DOM methods are actions, and DOM properties are values. Think of the DOM as a human body:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Elements are like body parts. (e.g., hands)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Properties describe them. (hand.color = brown)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Methods signify actions. (hand.move)&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;element.innerText //is a property.
element.setAttribute() //is a method.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Properties describe, methods do.&lt;/p&gt;

&lt;h2&gt;
  
  
  Events and EventListeners
&lt;/h2&gt;

&lt;p&gt;HTML events are occurrences that a web page can respond to. Events are like your web page saying "Hey, I got touched!" and event listeners are JavaScript's way of saying "I got this." It's liking teaching your web page stimuli and the responses to it.&lt;br&gt;
The addEventListener() method attaches an event handler to the specified element.&lt;br&gt;
Syntax:&lt;br&gt;
&lt;code&gt;element.addEventListener(event, function, useCapture);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Well, I guess that's enough as my introductory blog sharing about my learnings, I'll be back soon!&lt;/p&gt;

&lt;p&gt;Follow me on X: &lt;a href="https://x.com/sxryastacks" rel="noopener noreferrer"&gt;sxryastacks&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Basic Git and GitHub commands</title>
      <dc:creator> Suryadipta Ghosh</dc:creator>
      <pubDate>Tue, 09 Jul 2024 09:57:13 +0000</pubDate>
      <link>https://dev.to/sxryadipta/basic-git-and-github-commands-9jk</link>
      <guid>https://dev.to/sxryadipta/basic-git-and-github-commands-9jk</guid>
      <description>&lt;p&gt;Learning about version control system is an important part of your developer journey. As I started to code, one of the first things that I learnt was about Git and GitHub. Straight from the horse’s mouth, “Git is a free and open-source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.” It was created by Linus Torvalds in 2005 and has become the standard for version control in software development due to its efficiency and flexibility.&lt;br&gt;
On the other hand, GitHub is a web-based hosting service for Git repositories. It provides a platform where developers can store their Git repositories in the cloud, making it easier to collaborate with others. GitHub adds features on top of Git, such as issue tracking, pull requests, code review, and project management tools. Open-source projects and teams widely use it for managing and sharing code.&lt;/p&gt;

&lt;p&gt;Here are some of the basic commands of git that would help you get started using it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;git init&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initializes a new Git repository in the current directory.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git clone [repository_url]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clones a remote repository from GitHub or another Git hosting service to your local machine.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git add [file(s)]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adds file(s) to the staging area to prepare them for a commit.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git commit -m "commit message"&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Commits the staged changes to the repository with a descriptive message.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git status&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shows the current state of the working directory and staging area.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git pull&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetches changes from the remote repository and merges them into the current branch.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git push&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pushes your commits to the remote repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git branch&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lists all local branches in the repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git checkout [branch_name]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Switches to the specified branch.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git merge [branch_name]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Merges the specified branch into the current branch.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git remote -v&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lists the remote repositories associated with the local repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now let’s learn about some of the GitHub Commands:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;git remote add origin [repository_url]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sets up a remote repository on GitHub as the origin for your local repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git push -u origin [branch_name]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pushes the specified branch to GitHub and sets it as the upstream branch.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git pull origin [branch_name]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetches changes from GitHub and merges them into the current branch.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git clone [repository_url]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clones a repository from GitHub to your local machine.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git fork&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creates a copy of a repository on GitHub under your GitHub account.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git pull-request&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Opens a pull request on GitHub for merging changes from a branch.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;git fetch --all&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetches all branches from the remote repository to your local machine.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These commands cover the basic operations you'll perform when using Git and GitHub for version control and collaboration in software development.&lt;/p&gt;

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