<?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: Mirza Saikat Ahmmed</title>
    <description>The latest articles on DEV Community by Mirza Saikat Ahmmed (@mirzasaikatahmmed).</description>
    <link>https://dev.to/mirzasaikatahmmed</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%2F889602%2Fc83e9fc7-fc4c-4e2d-9d3c-e5a171974a5e.jpg</url>
      <title>DEV Community: Mirza Saikat Ahmmed</title>
      <link>https://dev.to/mirzasaikatahmmed</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mirzasaikatahmmed"/>
    <language>en</language>
    <item>
      <title>"Mastering Prisma ORM with NestJS: A Step-by-Step Guide to Installation and Connection Troubleshooting (Version 7.0.1)"</title>
      <dc:creator>Mirza Saikat Ahmmed</dc:creator>
      <pubDate>Sun, 30 Nov 2025 15:10:16 +0000</pubDate>
      <link>https://dev.to/mirzasaikatahmmed/mastering-prisma-orm-with-nestjs-a-step-by-step-guide-to-installation-and-connection-2e4h</link>
      <guid>https://dev.to/mirzasaikatahmmed/mastering-prisma-orm-with-nestjs-a-step-by-step-guide-to-installation-and-connection-2e4h</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Mastering Prisma ORM with NestJS: A Step-by-Step Guide to Installation and Connection Troubleshooting (Version 7.0.1)&lt;/span&gt;

In the rapidly evolving landscape of web development, effective database management is pivotal to any application's success. As developers, we strive to choose tools that simplify our workflows while enhancing performance. Prisma ORM combined with NestJS offers a robust solution for modern application needs. In this blog post, we'll explore the seamless integration of Prisma ORM into a NestJS application, guiding you through installation, setup, and connection troubleshooting specifically for version 7.0.1.

&lt;span class="gu"&gt;## Table of Contents&lt;/span&gt;
&lt;span class="p"&gt;1.&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;What is Prisma ORM?&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;#what-is-prisma-orm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;2.&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Prerequisites&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;#prerequisites&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;3.&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Installing Prisma and NestJS&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;#installing-prisma-and-nestjs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;4.&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Setting Up Prisma&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;#setting-up-prisma&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;5.&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Creating a Database Connection&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;#creating-a-database-connection&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;6.&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Connection Troubleshooting&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;#connection-troubleshooting&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;7.&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Testing the Connection&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;#testing-the-connection&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;8.&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Conclusion&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;#conclusion&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="gu"&gt;## What is Prisma ORM?&lt;/span&gt;
Prisma is an open-source database toolkit that streamlines interaction with your databases, making it easier to manage schemas, perform migrations, and execute queries. It abstracts much of the boilerplate code associated with traditional ORMs, allowing developers to focus on building their applications more efficiently.

&lt;span class="gu"&gt;## Prerequisites&lt;/span&gt;
Before diving into the installation process, ensure you have the following:
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="gs"&gt;**Node.js**&lt;/span&gt; (version 14 or above)
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**NestJS CLI**&lt;/span&gt; installed: 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
bash&lt;br&gt;
   npm install -g @nestjs/cli&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- A **database** of your choice (PostgreSQL, MySQL, SQLite, etc.)
- A **basic understanding** of TypeScript and NestJS

## Installing Prisma and NestJS

1. **Create a New NestJS Project:**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
bash&lt;br&gt;
   nest new my-nest-project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
2. **Navigate to the Project Directory:**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
bash&lt;br&gt;
   cd my-nest-project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
3. **Install Prisma and Required Packages:**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
bash&lt;br&gt;
   npm install @prisma/client prisma&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
4. **Initialize Prisma:**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
bash&lt;br&gt;
   npx prisma init&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
   This command creates a new `prisma` directory with a `schema.prisma` file, where you will define your data models.

## Setting Up Prisma
With Prisma initialized, it's time to define your data models:

1. Open the `prisma/schema.prisma` file and specify your database connection. Here’s an example configuration for a PostgreSQL database:

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

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
prisma&lt;br&gt;
   datasource db {&lt;br&gt;
     provider = "postgresql"&lt;br&gt;
     url      = env("DATABASE_URL")&lt;br&gt;
   }&lt;/p&gt;

&lt;p&gt;generator client {&lt;br&gt;
     provider = "prisma-client-js"&lt;br&gt;
   }&lt;/p&gt;

&lt;p&gt;model User {&lt;br&gt;
     id    Int     &lt;a class="mentioned-user" href="https://dev.to/id"&gt;@id&lt;/a&gt; &lt;a class="mentioned-user" href="https://dev.to/default"&gt;@default&lt;/a&gt;(autoincrement())&lt;br&gt;
     name  String&lt;br&gt;
     email String  &lt;a class="mentioned-user" href="https://dev.to/unique"&gt;@unique&lt;/a&gt;&lt;br&gt;
   }&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
2. Set your `DATABASE_URL` in the `.env` file:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DATABASE_URL="postgresql://USER:PASSWORD@localhost:5432/mydb"&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
3. **Run Migrations:**
   After defining your model, create the database tables with:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
bash&lt;br&gt;
   npx prisma migrate dev --name init&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
## Creating a Database Connection

1. **Create a Prisma Service:**
   Generate a service to interact with your Prisma client.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
bash&lt;br&gt;
   nest generate service prisma&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
2. **Implement the Prisma Client inside the Service:**
   Update `prisma.service.ts` to create a connection to your database.

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

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
typescript&lt;br&gt;
   import { Injectable } from '@nestjs/common';&lt;br&gt;
   import { PrismaClient } from '@prisma/client';&lt;/p&gt;

&lt;p&gt;@Injectable()&lt;br&gt;
   export class PrismaService extends PrismaClient {&lt;br&gt;
     constructor() {&lt;br&gt;
       super();&lt;br&gt;
     }&lt;br&gt;
   }&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
3. **Utilize the Prisma Service in Your Modules:**
   Import the Prisma service into any module needing database access.

## Connection Troubleshooting
If you encounter issues while connecting to the database, consider checking the following:

1. **Database URL:** Confirm that the `DATABASE_URL` is correctly formatted and the credentials are valid.
2. **Database Availability:** Ensure your database server is running. You can test connections using a database client like pgAdmin for PostgreSQL.
3. **Database Permissions:** Make sure the user specified in the `DATABASE_URL` has necessary permissions on the database.

## Testing the Connection
You can test the connection by creating a simple controller to interact with the Prisma service:

1. **Generate a User Controller:**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
bash&lt;br&gt;
   nest generate controller user&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
2. **Update the User Controller:**

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

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
typescript&lt;br&gt;
   import { Controller, Get } from '@nestjs/common';&lt;br&gt;
   import { PrismaService } from './prisma.service';&lt;/p&gt;

&lt;p&gt;@Controller('user')&lt;br&gt;
   export class UserController {&lt;br&gt;
     constructor(private readonly prisma: PrismaService) {}&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; @Get()
 async getUsers() {
   return this.prisma.user.findMany();
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;}&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
3. **Start Your NestJS Application:**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
bash&lt;br&gt;
   npm run start&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
Visit `http://localhost:3000/user` in your browser to verify if data retrieval is successful.

## Conclusion
Utilizing Prisma ORM in a NestJS application can significantly simplify your data management and streamline the development process. By following the steps outlined in this guide, you are well on your way to effectively integrating these powerful tools. Equipped with knowledge of connection troubleshooting and testing, you can confidently build scalable applications featuring robust database interactions.

Stay tuned for future posts where we will delve into advanced features of Prisma ORM, such as advanced querying capabilities, relational data modeling, and more.

---

For more insights and updates on web development, don’t forget to subscribe to our blog!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>database</category>
      <category>tutorial</category>
      <category>node</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Unlocking VS Code: The Ultimate Cheatsheet for Developers</title>
      <dc:creator>Mirza Saikat Ahmmed</dc:creator>
      <pubDate>Sat, 12 Oct 2024 21:08:50 +0000</pubDate>
      <link>https://dev.to/mirzasaikatahmmed/unlocking-vs-code-the-ultimate-cheatsheet-for-developers-5378</link>
      <guid>https://dev.to/mirzasaikatahmmed/unlocking-vs-code-the-ultimate-cheatsheet-for-developers-5378</guid>
      <description>&lt;p&gt;Visual Studio Code (VS Code) has become one of the most popular code editors among developers for its flexibility, vast extension marketplace, and robust features. Whether you’re a beginner or an experienced developer, mastering VS Code can significantly enhance your productivity. Here’s a handy cheatsheet that covers essential shortcuts, tips, and tricks to elevate your coding experience in VS Code.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Keyboard Shortcuts
&lt;/h2&gt;

&lt;p&gt;Familiarizing yourself with keyboard shortcuts is key to navigating VS Code efficiently. Here are some essential shortcuts:&lt;/p&gt;

&lt;h1&gt;
  
  
  General Shortcuts
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Open Command Palette: &lt;code&gt;Ctrl + Shift + P&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + Shift + P&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;li&gt;Open File: &lt;code&gt;Ctrl + O&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + O&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;li&gt;New File: &lt;code&gt;Ctrl + N&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + N&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;li&gt;Open Settings: &lt;code&gt;Ctrl + ,&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + ,&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Navigation
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Quick Open: &lt;code&gt;Ctrl + P&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + P&lt;/code&gt; (Mac) — Quickly open files by name.&lt;/li&gt;
&lt;li&gt;Go to Line: &lt;code&gt;Ctrl + G&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + G&lt;/code&gt; (Mac) — Jump to a specific line number.&lt;/li&gt;
&lt;li&gt;Switch Between Editor Tabs: &lt;code&gt;Ctrl + Tab&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + Option + →&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Editor Management
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Split Editor: &lt;code&gt;Ctrl + \&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + \&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;li&gt;Close Editor: &lt;code&gt;Ctrl + W&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + W&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;li&gt;Format Document: &lt;code&gt;Shift + Alt + F&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Shift + Option + F&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Extensions to Boost Productivity
&lt;/h2&gt;

&lt;p&gt;VS Code has a vast marketplace filled with extensions to enhance your development workflow. Here are a few must-have extensions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prettier: A code formatter that ensures your code is consistent and clean.&lt;/li&gt;
&lt;li&gt;Live Server: Launch a local development server with live reload for static and dynamic pages.&lt;/li&gt;
&lt;li&gt;GitLens: Supercharge your Git capabilities with detailed insights into code changes and history.&lt;/li&gt;
&lt;li&gt;Bracket Pair Colorizer: Colorizes matching brackets to improve code readability.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Integrated Terminal
&lt;/h2&gt;

&lt;p&gt;The integrated terminal in VS Code allows you to run commands directly within the editor. Here are some useful commands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Terminal: &lt;code&gt;Ctrl + `&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + `&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;li&gt;Create New Terminal: &lt;code&gt;Ctrl + Shift +&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + Shift +&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;li&gt;Kill Terminal: &lt;code&gt;Ctrl + Shift + X&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + Shift + X&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Version Control with Git
&lt;/h2&gt;

&lt;p&gt;VS Code provides built-in support for Git. Here are some Git-related shortcuts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Source Control Panel: &lt;code&gt;Ctrl + Shift + G&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + Shift + G&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;li&gt;Stage Changes: &lt;code&gt;Ctrl + Shift + U&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + Shift + U&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;li&gt;Commit Changes: Type a commit message and press &lt;code&gt;Ctrl + Enter&lt;/code&gt; (Windows/Linux) or &lt;code&gt;Cmd + Enter&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Customizing Your Setup
&lt;/h2&gt;

&lt;p&gt;Customizing VS Code to fit your workflow can make a significant difference. Here are some tips:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Themes: Change the look and feel of your editor with various themes available in the marketplace. Explore themes under &lt;code&gt;Preferences: Color Theme&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Settings Sync: Enable settings sync to keep your preferences across multiple devices.&lt;/li&gt;
&lt;li&gt;Keyboard Shortcuts: Customize shortcuts by navigating to &lt;code&gt;File&lt;/code&gt; &amp;gt; &lt;code&gt;Preferences&lt;/code&gt; &amp;gt; &lt;code&gt;Keyboard Shortcuts&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Mastering VS Code involves knowing the right shortcuts, utilizing extensions, and customizing your setup. With the tips in this cheatsheet, you’re well on your way to becoming a VS Code pro! &lt;/p&gt;

&lt;p&gt;You can connect with me on Linkedin: &lt;a href="https://www.linkedin.com/in/mirzasaikatahmmed/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/mirzasaikatahmmed/&lt;/a&gt;&lt;br&gt;
Follow me on GitHub: &lt;a href="https://github.com/mirzasaikatahmmed" rel="noopener noreferrer"&gt;https://github.com/mirzasaikatahmmed&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>webdev</category>
      <category>coding</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Git Cheatsheet that will make you a master in Git</title>
      <dc:creator>Mirza Saikat Ahmmed</dc:creator>
      <pubDate>Sun, 29 Sep 2024 11:14:31 +0000</pubDate>
      <link>https://dev.to/mirzasaikatahmmed/git-cheatsheet-that-will-make-you-a-master-in-git-1c2n</link>
      <guid>https://dev.to/mirzasaikatahmmed/git-cheatsheet-that-will-make-you-a-master-in-git-1c2n</guid>
      <description>&lt;h2&gt;
  
  
  Introduction to Git
&lt;/h2&gt;

&lt;p&gt;Git is a widely used version control system that allows developers to track changes and collaborate on projects. It has become an essential tool for managing code changes, whether working solo or in a team. However, mastering Git can be a challenge, especially for beginners who are not familiar with its commands and features. In this Git cheatsheet, we will cover both the basic and advanced Git commands that every developer should know. From creating a repository to branching, merging, and beyond, this cheatsheet will serve as a handy reference guide for anyone looking to improve their Git skills and become a more proficient developer. Whether you are just starting with Git or looking to enhance your existing knowledge, this cheatsheet will help you make the most out of Git and optimize your workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Basic Git commands
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Initialization
&lt;/h2&gt;

&lt;p&gt;To initialize a new Git repository in the current directory, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a hidden .git directory in the current directory that tracks changes to your code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloning
&lt;/h2&gt;

&lt;p&gt;To clone an existing Git repository to your local machine, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone &amp;lt;repository URL&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a new directory on your computer with a copy of the repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Staging changes
&lt;/h2&gt;

&lt;p&gt;Before you commit changes to your code, you need to stage them using the git add command. This tells Git which changes you want to include in your commit.&lt;br&gt;
To stage a file or directory, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add &amp;lt;file/directory&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also stage all changes in the current directory by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Committing changes
&lt;/h2&gt;

&lt;p&gt;To commit the changes in the staging area with a commit message, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m "&amp;lt;commit message&amp;gt;"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The commit message should briefly describe the changes you made in the commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking status
&lt;/h2&gt;

&lt;p&gt;To check the current status of your repository, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will show you which files have been modified, which files are staged for commit, and which files are untracked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Viewing changes
&lt;/h2&gt;

&lt;p&gt;To view the changes between the working directory and the staging area, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git diff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To view the changes between the staging area and the last commit, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git diff --cached
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Branching
&lt;/h2&gt;

&lt;p&gt;Git allows you to create multiple branches of your code so that you can work on different features or fixes without affecting the main codebase. The default branch in Git is called &lt;code&gt;master.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To create a new branch with the specified name, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch &amp;lt;branch name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To switch to the specified branch, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout &amp;lt;branch name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also create and switch to a new branch in one command by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -b &amp;lt;branch name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To merge the specified branch into the current branch, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git merge &amp;lt;branch name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pushing changes
&lt;/h2&gt;

&lt;p&gt;To push changes to a remote repository, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push &amp;lt;remote&amp;gt; &amp;lt;branch&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt; is the name of the remote repository, and  is the name of the branch you want to push.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pulling changes
&lt;/h2&gt;

&lt;p&gt;To pull changes from a remote repository, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git pull &amp;lt;remote&amp;gt; &amp;lt;branch&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;&amp;lt;remote&amp;gt;&lt;/code&gt; is the name of the remote repository, and &lt;code&gt;&amp;lt;branch&amp;gt;&lt;/code&gt; is the name of the branch you want to pull.&lt;/p&gt;

&lt;h2&gt;
  
  
  Viewing history
&lt;/h2&gt;

&lt;p&gt;To view the commit history, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will show you a list of all the commits in the repository, along with the commit message, author, and date.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advanced Git commands
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Reverting changes
&lt;/h2&gt;

&lt;p&gt;If you need to undo a commit, you can use the &lt;code&gt;git revert&lt;/code&gt; command. This creates a new commit that undoes the changes made in the specified commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resetting changes
&lt;/h2&gt;

&lt;p&gt;If you want to undo a commit and remove it from the commit history, you can use the &lt;code&gt;git reset&lt;/code&gt; command. This removes the specified commit and all subsequent commits from the commit history. There are three options for &lt;code&gt;git reset&lt;/code&gt;: &lt;code&gt;--soft&lt;/code&gt;, &lt;code&gt;--mixed&lt;/code&gt;, and &lt;code&gt;--hard&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--soft&lt;/code&gt;&lt;br&gt;
 only resets the commit history and leaves the changes in the staging area.&lt;br&gt;
&lt;code&gt;--mixed&lt;/code&gt; resets the commit history and unstages the changes.&lt;br&gt;
&lt;code&gt;--hard&lt;/code&gt; resets the commit history, unstages the changes, and discards all changes made after the specified commit.&lt;/p&gt;

&lt;p&gt;To reset the last commit using &lt;code&gt;--soft&lt;/code&gt;, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reset --soft HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To reset the last commit using &lt;code&gt;--mixed&lt;/code&gt;, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reset --mixed HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To reset the last commit using &lt;code&gt;--hard&lt;/code&gt;, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reset --hard HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Rebasing
&lt;/h2&gt;

&lt;p&gt;If you want to apply your changes to a different branch, you can use the git rebase command. This command applies your changes on top of the specified branch.&lt;br&gt;
To rebase the current branch onto the specified branch, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git rebase &amp;lt;branch name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Stashing
&lt;/h2&gt;

&lt;p&gt;If you want to save changes without committing them, you can use the git stash command. This saves the changes in a stack of temporary commits, allowing you to switch to a different branch or work on something else.&lt;br&gt;
To stash your changes, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To apply your changes again, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash apply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Cherry-picking
&lt;/h2&gt;

&lt;p&gt;If you want to apply a specific commit from one branch to another, you can use the git cherry-pick command. This command applies the specified commit on top of the current branch.&lt;br&gt;
To cherry-pick the specified commit, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git cherry-pick &amp;lt;commit hash&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Git hooks
&lt;/h2&gt;

&lt;p&gt;Git hooks are scripts that run automatically before or after specific Git commands, allowing you to customize the behavior of Git. Git comes with a set of built-in hooks, but you can also create your own custom hooks.&lt;br&gt;
To create a custom Git hook, navigate to the &lt;code&gt;.git/hooks&lt;/code&gt; directory in your Git repository and create a new file with the name of the hook you want to create (e.g., &lt;code&gt;pre-commit&lt;/code&gt;, &lt;code&gt;post-merge&lt;/code&gt;). The file should be executable and contain the script you want to run.&lt;/p&gt;
&lt;h2&gt;
  
  
  Git aliases
&lt;/h2&gt;

&lt;p&gt;Git aliases are shortcuts for Git commands, allowing you to save time and type less. You can create your own custom aliases using the &lt;code&gt;git config&lt;/code&gt; command.&lt;br&gt;
To create a new alias, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global alias.&amp;lt;alias name&amp;gt; '&amp;lt;command&amp;gt;'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;&amp;lt;alias name&amp;gt;&lt;/code&gt; is the name of the alias you want to create, and &lt;code&gt;&amp;lt;command&amp;gt;&lt;/code&gt; is the Git command you want to alias.&lt;/p&gt;

&lt;h2&gt;
  
  
  Git workflows
&lt;/h2&gt;

&lt;p&gt;Git workflows are strategies for using Git to manage code changes in a team. There are several popular Git workflows, including the centralized workflow, the feature branch workflow, and the Gitflow workflow.&lt;br&gt;
The centralized workflow is a simple workflow that involves a single main branch, with all changes made directly to that branch.&lt;br&gt;
The feature branch workflow involves creating a new branch for each feature or bug fix, and merging those branches back into the main branch when the changes are complete.&lt;br&gt;
The Gitflow workflow is a more complex workflow that involves multiple branches, including a &lt;code&gt;develop&lt;/code&gt; branch for ongoing development, a &lt;code&gt;release&lt;/code&gt; branch for preparing releases, and &lt;code&gt;feature&lt;/code&gt; branches for individual features.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, Git is a powerful tool for version control and managing code changes. It allows developers to collaborate on projects, track changes, and revert to previous versions when necessary. While the basic Git commands are essential to know, the advanced Git commands discussed in this cheat sheet can help you be more efficient and effective when working with Git.&lt;/p&gt;

&lt;p&gt;You can connect with me on Linkedin: &lt;a href="https://www.linkedin.com/in/mirzasaikatahmmed/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/mirzasaikatahmmed/&lt;/a&gt;&lt;br&gt;
Follow me on GitHub: &lt;a href="https://github.com/mirzasaikatahmmed" rel="noopener noreferrer"&gt;https://github.com/mirzasaikatahmmed&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>cheatsheet</category>
      <category>programming</category>
    </item>
    <item>
      <title>Create Personal Portfolio Using Github Api with Blog</title>
      <dc:creator>Mirza Saikat Ahmmed</dc:creator>
      <pubDate>Tue, 02 Aug 2022 12:48:43 +0000</pubDate>
      <link>https://dev.to/mirzasaikatahmmed/create-personal-portfolio-using-github-api-with-blog-1270</link>
      <guid>https://dev.to/mirzasaikatahmmed/create-personal-portfolio-using-github-api-with-blog-1270</guid>
      <description>&lt;p&gt;For a developer, a personal portfolio plays an important role to showcase his/her works, reach to potential clients or land a job. But making it requires a tremendous amount of works and time. Also maintaining it manually with the latest project is a pain.&lt;/p&gt;

&lt;p&gt;What if you could create your portfolio in 5 minutes just by providing your Github username and even host it without any cost? Do you want to display your skills, job history, education history, or even dev.to posts to your website? Then you are in right place.&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%2Fo05atub29jchkijdeusy.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%2Fo05atub29jchkijdeusy.png" alt="Image description" width="800" height="390"&gt;&lt;/a&gt;&lt;br&gt;
Introducing GitProfile to kickstart your personal portfolio with Github Api and blog.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
