<?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: Pratik Kale</title>
    <description>The latest articles on DEV Community by Pratik Kale (@pratik_kale).</description>
    <link>https://dev.to/pratik_kale</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%2F615131%2F28ea1033-f65a-483f-b3a3-865ebec49526.jpeg</url>
      <title>DEV Community: Pratik Kale</title>
      <link>https://dev.to/pratik_kale</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pratik_kale"/>
    <language>en</language>
    <item>
      <title>How to Manage Google Cloud Compute Engine with Python</title>
      <dc:creator>Pratik Kale</dc:creator>
      <pubDate>Fri, 08 Sep 2023 09:47:46 +0000</pubDate>
      <link>https://dev.to/pratik_kale/how-to-manage-google-cloud-compute-engine-with-python-9jd</link>
      <guid>https://dev.to/pratik_kale/how-to-manage-google-cloud-compute-engine-with-python-9jd</guid>
      <description>&lt;p&gt;Compute Engine is an IaaS offering by Google Cloud. It is a powerful platform that can be used to create and manage virtual machines. However, managing Compute Engine can be a complex task. In this blog post, I will show you how to use Python to automate the management of Compute Engine instances.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up your environment
&lt;/h2&gt;

&lt;p&gt;Make sure you have python and pip installed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Mac/Linux&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;virtualenv
virtualenv &amp;lt;your-env&amp;gt;
&lt;span class="nb"&gt;source&lt;/span&gt; &amp;lt;your-env&amp;gt;/bin/activate
&amp;lt;your-env&amp;gt;/bin/pip &lt;span class="nb"&gt;install &lt;/span&gt;google-cloud-compute
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;virtualenv
virtualenv &amp;lt;your-env&amp;gt;
&amp;lt;your-env&amp;gt;&lt;span class="se"&gt;\S&lt;/span&gt;cripts&lt;span class="se"&gt;\a&lt;/span&gt;ctivate
&amp;lt;your-env&amp;gt;&lt;span class="se"&gt;\S&lt;/span&gt;cripts&lt;span class="se"&gt;\p&lt;/span&gt;ip.exe &lt;span class="nb"&gt;install &lt;/span&gt;google-cloud-compute
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Authentication
&lt;/h3&gt;

&lt;p&gt;For authentication let's create a service account.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;IAM &amp;amp; Admin --&amp;gt; Service Accounts&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on CREATE SERVICE ACCOUNT.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--knWw6MlF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yggqbwymhnxdqdhypuc8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--knWw6MlF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yggqbwymhnxdqdhypuc8.png" alt="Create Service Account" width="211" height="38"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Add a Service account name and Service account ID.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--r6k9B8d5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1694104179772/dd3b8d3b-8f34-4723-89c5-afdd4e212dec.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--r6k9B8d5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1694104179772/dd3b8d3b-8f34-4723-89c5-afdd4e212dec.png" alt="Service account" width="578" height="364"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click on CREATE AND CONTINUE.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2Jakh69z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1694104218300/78d1b2ad-d70f-4ced-9513-0a219d5b9cdc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2Jakh69z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1694104218300/78d1b2ad-d70f-4ced-9513-0a219d5b9cdc.png" alt="Create" width="530" height="346"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add Role of Compute Admin.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on DONE.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now let's generate a JSON key which we can use in our local environment.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Click on the service account name you just created.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click on the KEYS option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IBOyPBd9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1694104875559/e93a05fa-eeb7-4a98-972a-7320195d97bf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IBOyPBd9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1694104875559/e93a05fa-eeb7-4a98-972a-7320195d97bf.png" alt="Keys" width="514" height="43"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ADD KEY --&amp;gt; Create new key&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select JSON and click on CREATE.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Download and Save the key.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now that we have authentications sorted let's look at some code!&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating a new VM instance
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;google.cloud&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;compute_v1&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;

&lt;span class="c1"&gt;# Using os we are storing the service account json key in the variable
&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"GOOGLE_APPLICATION_CREDENTIALS"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"key.json"&lt;/span&gt;

&lt;span class="n"&gt;INSTANCE_NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'instance-name'&lt;/span&gt;
&lt;span class="n"&gt;MACHINE_TYPE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'projects/project-id/zones/us-west4-b/machineTypes/e2-medium'&lt;/span&gt; 
&lt;span class="n"&gt;SUBNETWORK&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'projects/project-id/regions/us-west4/subnetworks/default'&lt;/span&gt;
&lt;span class="n"&gt;SOURCE_IMAGE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'projects/project-id/global/images/ubuntu-2004-focal-v20230831'&lt;/span&gt;
&lt;span class="n"&gt;NETWORK_INTERFACE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s"&gt;'subnetwork'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;SUBNETWORK&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;'access_configs'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="s"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s"&gt;'External NAT'&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;compute_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;compute_v1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InstancesClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s"&gt;'name'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;INSTANCE_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;'machine_type'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;MACHINE_TYPE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;'disks'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="s"&gt;'boot'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s"&gt;'auto_delete'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s"&gt;'initialize_params'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="s"&gt;'source_image'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;SOURCE_IMAGE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;

    &lt;span class="s"&gt;'network_interfaces'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;NETWORK_INTERFACE&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Creating instace....."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;operation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;compute_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'project-id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'us-west4-b'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;instance_resource&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;'Created VM Instance:&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;INSTANCE_NAME&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Imported Modules :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://google.cloud"&gt;&lt;code&gt;google.cloud&lt;/code&gt;&lt;/a&gt;&lt;code&gt;.compute_v1&lt;/code&gt;: This module provides the client library for the Google Cloud Compute Engine API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;os&lt;/code&gt;: This module provides access to operating system functionality.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is how the code works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Sets the environment variable &lt;code&gt;GOOGLE_APPLICATION_CREDENTIALS&lt;/code&gt; to the path of the JSON file that contains the Google Cloud service account credentials.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Defines the following variables:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* `INSTANCE_NAME`: The name of the instance to create.

* `MACHINE_TYPE`: The machine type of the instance to create.

* `SUBNETWORK`: The subnetwork of the instance to create.

* `SOURCE_IMAGE`: The image to use for the instance.

* `NETWORK_INTERFACE`: The network interface of the instance to create.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Creates an instance of the &lt;code&gt;InstancesClient&lt;/code&gt; class. This class provides methods for managing Google Compute Engine instances.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Creates a dictionary called &lt;code&gt;config&lt;/code&gt;. This dictionary contains the configuration for the instance to create.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Calls the &lt;code&gt;insert()&lt;/code&gt; method of the &lt;code&gt;InstancesClient&lt;/code&gt; class. This method creates the instance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Waits for the operation to complete.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Prints the name of the instance that was created.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you are not sure about arguments like &lt;code&gt;MACHINE_TYPE&lt;/code&gt; or &lt;code&gt;SOURCE_IMAGE&lt;/code&gt; then you can refer to the Google Cloud Console.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Compute Engine --&amp;gt; VM instances&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on CREATE INSTANCE.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose the arguments according to you.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once done click on the EQUIVALENT CODE option in the upper right corner and choose REST&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FANdd0P_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1694106656367/c6b3c833-f2d1-4fd9-9136-1c899f6acd02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FANdd0P_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1694106656367/c6b3c833-f2d1-4fd9-9136-1c899f6acd02.png" alt="Code" width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here you can see all the available arguments and you can choose as per your requirements.&lt;/p&gt;
&lt;h2&gt;
  
  
  List all the VM instances
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;google.cloud&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;compute_v1&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;collections&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;defaultdict&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;

&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"GOOGLE_APPLICATION_CREDENTIALS"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"key.json"&lt;/span&gt;

&lt;span class="n"&gt;instace_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;compute_v1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InstancesClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;request&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;compute_v1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AggregatedListInstancesRequest&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'project-id'&lt;/span&gt;

&lt;span class="n"&gt;agg_list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;instace_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;aggregated_list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;all_instances&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;defaultdict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Instances found:"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;zone&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;agg_list&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;instances&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;all_instances&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;zone&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;instances&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;" &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;zone&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;:"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;instance&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;instances&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;" - &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; (&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;machine_type&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;) &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Imported Modules :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;collections.defaultdict&lt;/code&gt;: This module provides a defaultdict data structure, which is a dictionary where the default value is set to a specified value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is how the code works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Sets the environment variable &lt;code&gt;GOOGLE_APPLICATION_CREDENTIALS&lt;/code&gt; to the path of the JSON file that contains the Google Cloud service account credentials.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Creates an instance of the &lt;code&gt;InstancesClient&lt;/code&gt; class. This class provides methods for managing Google Compute Engine instances.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Creates an instance of the &lt;code&gt;AggregatedListInstancesRequest&lt;/code&gt; class. This class represents a request to list Google Compute Engine instances.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sets the project ID of the project that contains the instances to list.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Calls the &lt;code&gt;aggregated_list()&lt;/code&gt; method of the &lt;code&gt;InstancesClient&lt;/code&gt; class. This method lists the instances in the specified project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Creates a dictionary called &lt;code&gt;all_instances&lt;/code&gt;. This dictionary will be used to store the instances that are found.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Iterates over the response from the &lt;code&gt;aggregated_list()&lt;/code&gt; method.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For each zone in the response, adds the instances in that zone to the &lt;code&gt;all_instances&lt;/code&gt; dictionary.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Prints the name, machine type, and status of each instance in the &lt;code&gt;all_instances&lt;/code&gt; dictionary.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CSGQrt64--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1694107474189/d6707a62-5a47-4da3-b5c0-219455a11547.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CSGQrt64--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1694107474189/d6707a62-5a47-4da3-b5c0-219455a11547.png" alt="output" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This how the output looks like. I have printed the instance name, machine type and status but you can print every attribute of the instance from the &lt;code&gt;all_instances&lt;/code&gt; dictionary.&lt;/p&gt;
&lt;h2&gt;
  
  
  Start and stop a VM instance
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;google.cloud&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;compute_v1&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;

&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"GOOGLE_APPLICATION_CREDENTIALS"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"key.json"&lt;/span&gt;

&lt;span class="n"&gt;compute_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;compute_v1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InstancesClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;operation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;compute_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'project-id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'us-west4-b'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;instance&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'python-instance'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Instace Stopped!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This is straightforward. All you have to provide is project-id, zone and instance name.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Creates an instance of the &lt;code&gt;InstancesClient&lt;/code&gt; class. This class provides methods for managing Google Compute Engine instances.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Calls the &lt;code&gt;stop()&lt;/code&gt; method of the &lt;code&gt;InstancesClient&lt;/code&gt; class. This method stops the instance.  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The same applies for starting an instance. Rather than stop you have to use the start method rest is the same.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;google.cloud&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;compute_v1&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;

&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"GOOGLE_APPLICATION_CREDENTIALS"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"key.json"&lt;/span&gt;

&lt;span class="n"&gt;compute_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;compute_v1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InstancesClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;operation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;compute_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'project-id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'us-west4-b'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;instance&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'python-instance'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Instace Started!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Delete a VM Instance
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;google.cloud&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;compute_v1&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;

&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"GOOGLE_APPLICATION_CREDENTIALS"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"key.json"&lt;/span&gt;

&lt;span class="n"&gt;compute_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;compute_v1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InstancesClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;operation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;compute_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'project-id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'us-west4-b'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;instance&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'instance-name'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Instace deleted successfully!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Deleting also has the same logic as starting or stopping.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Creates an instance of the &lt;code&gt;InstancesClient&lt;/code&gt; class. This class provides methods for managing Google Compute Engine instances.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Calls the &lt;code&gt;delete()&lt;/code&gt; method of the &lt;code&gt;InstancesClient&lt;/code&gt; class. This method deletes the instance.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All the code mentioned in this blog is available on GitHub&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/pratikkalein"&gt;
        pratikkalein
      &lt;/a&gt; / &lt;a href="https://github.com/pratikkalein/GCP-Python"&gt;
        GCP-Python
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Python code for operations on Google Cloud compute engine
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;That's all about how you can manage VM instances using python. Let me know your thoughts or if I missed something in the comments.&lt;/p&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

&lt;p&gt;Connect With Me :&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://pratik.linkb.org/" rel="noopener noreferrer"&gt;
      pratik.linkb.org
    &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>python</category>
      <category>googlecloud</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Best Practices for Using Git and GitHub</title>
      <dc:creator>Pratik Kale</dc:creator>
      <pubDate>Sun, 02 Jul 2023 19:36:49 +0000</pubDate>
      <link>https://dev.to/pratik_kale/best-practices-for-using-git-and-github-6em</link>
      <guid>https://dev.to/pratik_kale/best-practices-for-using-git-and-github-6em</guid>
      <description>&lt;p&gt;Welcome to the eighteenth blog of the series!&lt;/p&gt;

&lt;p&gt;Now that we have gone through how you can get started with Git &amp;amp; GitHub.However, it's important to follow best practices to ensure a smooth and efficient Git workflow. In this blog post, we will explore some of the best practices for using Git and GitHub, including branching strategies, commit conventions, code reviews, and more. Let's dive in!&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Choose an Appropriate Branching Strategy
&lt;/h2&gt;

&lt;p&gt;A well-defined branching strategy helps in organizing and managing your codebase. Here are two popular branching strategies:&lt;/p&gt;

&lt;h3&gt;
  
  
  a. GitFlow
&lt;/h3&gt;

&lt;p&gt;GitFlow is a branching model that emphasizes the separation of development work and release processes. It consists of two main branches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;master&lt;/code&gt;: Represents the stable production-ready code.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;develop&lt;/code&gt;: Serves as the integration branch for ongoing development.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally, GitFlow incorporates feature branches for new features, hotfix branches for bug fixes, and release branches for version releases.&lt;/p&gt;

&lt;p&gt;To create a new feature branch using GitFlow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create a new feature branch&lt;/span&gt;
git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; feature/my-feature develop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  b. Trunk-Based Development
&lt;/h3&gt;

&lt;p&gt;Trunk-Based Development promotes a simpler branching model with a single long-lived branch, often named &lt;code&gt;main&lt;/code&gt; or &lt;code&gt;master&lt;/code&gt;. Developers directly commit their changes to this branch, eliminating the need for long-lived feature branches.&lt;/p&gt;

&lt;p&gt;To commit changes directly to the main branch:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Make changes to your code&lt;/span&gt;
git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Your commit message"&lt;/span&gt;
git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Choose a branching strategy that suits your team's needs and ensure everyone understands and follows it consistently.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Write Clear and Descriptive Commit Messages
&lt;/h2&gt;

&lt;p&gt;Commit messages are crucial for understanding the purpose and context of code changes. Follow these guidelines when writing commit messages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep messages concise but descriptive.&lt;/li&gt;
&lt;li&gt;Use the imperative mood ("Fix bug" instead of "Fixed bug").&lt;/li&gt;
&lt;li&gt;Reference relevant issue or ticket numbers, if applicable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Add authentication middleware

This commit adds a new middleware &lt;span class="k"&gt;for &lt;/span&gt;handling user authentication.
It checks the validity of user tokens before processing requests.
Fixes &lt;span class="c"&gt;#123&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  3. Perform Regular Pulls and Branch Updates
&lt;/h2&gt;

&lt;p&gt;To ensure you are working with the latest code and avoid conflicts, regularly pull changes from the remote repository and update your branches.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Switch to the branch you want to update&lt;/span&gt;
git checkout my-branch

&lt;span class="c"&gt;# Fetch the latest changes&lt;/span&gt;
git fetch origin

&lt;span class="c"&gt;# Merge the changes from the remote branch into your local branch&lt;/span&gt;
git merge origin/my-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  4. Utilize Pull Requests and Code Reviews
&lt;/h2&gt;

&lt;p&gt;Pull Requests (PRs) and code reviews are essential for maintaining code quality and ensuring collaboration. Here's a typical workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new branch for your feature or bug fix.&lt;/li&gt;
&lt;li&gt;Make your changes, commit them, and push the branch to the remote repository.&lt;/li&gt;
&lt;li&gt;Open a PR on GitHub.&lt;/li&gt;
&lt;li&gt;Request reviews from your team members.&lt;/li&gt;
&lt;li&gt;Address any feedback and make necessary changes.&lt;/li&gt;
&lt;li&gt;Once approved, merge the PR into the main branch.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Code reviews provide an opportunity for knowledge sharing, catching bugs, and improving code readability.&lt;/p&gt;
&lt;h2&gt;
  
  
  5. Use Issue Tracking and Milestones
&lt;/h2&gt;

&lt;p&gt;GitHub's issue tracking features allow you to effectively manage and track tasks, bugs, and feature requests. Utilize issues and milestones to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Document and discuss specific tasks or bugs.&lt;/li&gt;
&lt;li&gt;Assign issues to team members.&lt;/li&gt;
&lt;li&gt;Track progress using milestones and labels.&lt;/li&gt;
&lt;li&gt;Provide a centralized location for discussions and collaboration.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  6. Regularly Update and Rebase Long-Lived Branches
&lt;/h2&gt;

&lt;p&gt;Long-lived branches like develop or main can diverge from other branches over time. To keep them up-to-date and minimize conflicts, periodically rebase or merge changes from other branches.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Update your branch with the latest changes from main&lt;/span&gt;
git checkout my-branch
git pull origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;Following best practices when using Git and GitHub can significantly improve your development workflow, collaboration, and code quality. Choosing an appropriate branching strategy, writing clear commit messages, performing regular pulls and updates, leveraging pull requests and code reviews, utilizing issue tracking, and keeping long-lived branches up-to-date are all essential practices. By incorporating these practices into your development process, you can ensure a smooth and efficient Git and GitHub experience for yourself and your team. Happy coding!&lt;/p&gt;

&lt;p&gt;Thank you for reading and do let me know your thoughts in comments!&lt;/p&gt;

&lt;p&gt;Connect With Me :&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__615131"&gt;
    &lt;a href="/pratik_kale" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&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%2Fuser%2Fprofile_image%2F615131%2F28ea1033-f65a-483f-b3a3-865ebec49526.jpeg" alt="pratik_kale image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/pratik_kale"&gt;Pratik Kale&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/pratik_kale"&gt;Software Enginner @ Impulsive Web | Organizer @GDG Cloud Pune | Google DSC Lead '21 | Tech Geek 💻 | Learner 📔&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://pratikkale.in"&gt;Website&lt;/a&gt; | &lt;a href="https://twitter.com/pratikkalein"&gt;Twitter&lt;/a&gt; | &lt;a href="https://www.instagram.com/prato.grapher/"&gt;Instagram&lt;/a&gt; | &lt;a href="//mailto:ppvkale@gmail.com"&gt;Mail&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Troubleshooting Common Git Issues</title>
      <dc:creator>Pratik Kale</dc:creator>
      <pubDate>Sun, 02 Jul 2023 19:16:42 +0000</pubDate>
      <link>https://dev.to/pratik_kale/troubleshooting-common-git-issues-2jhn</link>
      <guid>https://dev.to/pratik_kale/troubleshooting-common-git-issues-2jhn</guid>
      <description>&lt;p&gt;Welcome to the seventeenth blog of the series!&lt;/p&gt;

&lt;p&gt;Git is a powerful version control system that helps developers track changes to their codebase efficiently. However, like any other tool, Git can sometimes throw errors or present unexpected behavior. In this blog post, we will explore some common Git issues that developers encounter and provide troubleshooting steps to resolve them. Whether you're a beginner or an experienced Git user, understanding how to troubleshoot these issues will help you maintain a smooth Git workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;1. Git Repository Not Found&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you encounter the error "fatal: repository not found" when trying to clone a repository or perform Git operations, it typically indicates an issue with the repository URL or permissions. Here's how to troubleshoot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Double-check the repository URL: Ensure that you have the correct repository URL. Verify if the URL is spelled correctly and includes the correct username or organization name.&lt;/li&gt;
&lt;li&gt;Check repository permissions: If you're trying to clone a private repository, make sure you have the necessary permissions to access it. If the repository is owned by an organization, ensure that you are a member with the appropriate access rights.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;2. Merge Conflicts&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Merge conflicts occur when Git cannot automatically merge changes from different branches. It happens when multiple developers make conflicting changes to the same file or lines of code. Here's how to resolve merge conflicts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identify conflicting files: Git will mark the conflicting files in your repository. Open these files in a text editor to locate the conflict markers (&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;, =======, and &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;).&lt;/li&gt;
&lt;li&gt;Resolve conflicts manually: Edit the conflicting sections, keeping the desired changes and removing the conflict markers. Alternatively, you can use a visual merge tool like &lt;code&gt;git mergetool&lt;/code&gt; to assist in resolving conflicts.&lt;/li&gt;
&lt;li&gt;Commit the changes: After resolving the conflicts, save the file, and stage it using &lt;code&gt;git add &amp;lt;file&amp;gt;&lt;/code&gt;. Finally, commit the changes with &lt;code&gt;git commit&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;3. Detached HEAD State&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The "detached HEAD" state occurs when you checkout a specific commit instead of a branch. This state can make it difficult to work with branches and commit changes. Here's how to recover from a detached HEAD state:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new branch: Create a new branch at the current commit using &lt;code&gt;git branch &amp;lt;new-branch-name&amp;gt;&lt;/code&gt;. This branch will be based on the commit you are currently on.&lt;/li&gt;
&lt;li&gt;Checkout the new branch: Switch to the newly created branch with &lt;code&gt;git checkout &amp;lt;new-branch-name&amp;gt;&lt;/code&gt;. You can now continue working on this branch.&lt;/li&gt;
&lt;li&gt;Optional: Merge or rebase changes: If you have uncommitted changes in the detached HEAD state that you want to include in the new branch, you can merge or rebase those changes onto the new branch.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;4. Untracked Files&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Untracked files are files that Git is not currently tracking. They are typically new files that you have added to your project. To start tracking these files, use the following steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add the files to the Git index: Stage the untracked files using &lt;code&gt;git add &amp;lt;file&amp;gt;&lt;/code&gt; or &lt;code&gt;git add .&lt;/code&gt; to add all untracked files in the current directory.&lt;/li&gt;
&lt;li&gt;Commit the changes: After adding the files to the Git index, commit the changes using &lt;code&gt;git commit -m "Your commit message"&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;5. Authentication Failed&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you encounter authentication errors when pushing or pulling from a remote repository, it typically means there is an issue with your authentication credentials. Here's what you can do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verify credentials: Double-check that you have entered the correct username and password or SSH key for the remote repository.&lt;/li&gt;
&lt;li&gt;Update authentication method: If you're using HTTPS, consider switching to SSH authentication for a more secure and seamless experience. Follow the appropriate documentation to set up SSH keys for your Git hosting provider.&lt;/li&gt;
&lt;li&gt;Clear cached credentials: If you have recently changed your authentication credentials, try clearing the cached credentials on your local machine using the appropriate methods for your operating system.&lt;/li&gt;
&lt;li&gt;Check firewall or proxy settings: If you're behind a firewall or using a proxy, ensure that your Git client is configured correctly to work with your network settings.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Troubleshooting common Git issues is an essential skill for any developer using version control. By understanding these common issues and their solutions, you can overcome obstacles and maintain a smooth Git workflow. Remember to double-check repository URLs, resolve merge conflicts carefully, recover from detached HEAD states, track untracked files, and verify authentication credentials to address common Git issues effectively. With these troubleshooting techniques in your toolkit, you'll be well-equipped to navigate Git-related challenges with confidence.&lt;/p&gt;

&lt;p&gt;Thank you for reading and do let me know your thoughts in comments!&lt;/p&gt;

&lt;p&gt;Connect With Me :&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__615131"&gt;
    &lt;a href="/pratik_kale" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&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%2Fuser%2Fprofile_image%2F615131%2F28ea1033-f65a-483f-b3a3-865ebec49526.jpeg" alt="pratik_kale image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/pratik_kale"&gt;Pratik Kale&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/pratik_kale"&gt;Software Enginner @ Impulsive Web | Organizer @GDG Cloud Pune | Google DSC Lead '21 | Tech Geek 💻 | Learner 📔&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
 &lt;br&gt;
&lt;a href="https://pratikkale.in"&gt;Website&lt;/a&gt; | &lt;a href="https://twitter.com/pratikkalein"&gt;Twitter&lt;/a&gt; | &lt;a href="https://www.instagram.com/prato.grapher/"&gt;Instagram&lt;/a&gt; | &lt;a href="//mailto:ppvkale@gmail.com"&gt;Mail&lt;/a&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Integrating GitHub with Other Tools</title>
      <dc:creator>Pratik Kale</dc:creator>
      <pubDate>Sun, 02 Jul 2023 18:57:04 +0000</pubDate>
      <link>https://dev.to/pratik_kale/integrating-github-with-other-tools-5g7g</link>
      <guid>https://dev.to/pratik_kale/integrating-github-with-other-tools-5g7g</guid>
      <description>&lt;p&gt;Welcome to the sixteenth blog of the series!&lt;/p&gt;

&lt;p&gt;GitHub is not just a code hosting platform; it also provides seamless integration with a wide range of tools and services. These integrations can enhance your development workflow, automate tasks, and improve collaboration. In this blog post, we will explore some of the ways you can integrate GitHub with other tools and make the most out of your development process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Continuous Integration and Deployment (CI/CD)
&lt;/h2&gt;

&lt;p&gt;One of the most common integrations with GitHub is setting up Continuous Integration and Deployment (CI/CD) pipelines. CI/CD allows you to automate the building, testing, and deployment of your applications. Here's an example of integrating GitHub with popular CI/CD tools:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. GitHub Actions&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;GitHub Actions is a powerful built-in CI/CD solution provided by GitHub. It allows you to define workflows using YAML files directly in your repository. Here's a basic example of a GitHub Actions workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;CI&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Checkout code&lt;/span&gt;
      &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build and test&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;npm install&lt;/span&gt;
        &lt;span class="s"&gt;npm run build&lt;/span&gt;
        &lt;span class="s"&gt;npm run test&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;# Add deployment steps here&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;With this configuration, every push to the &lt;code&gt;main&lt;/code&gt; branch will trigger the defined workflow, including building, testing, and deploying your application.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;2. Jenkins&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Jenkins is a popular open-source CI/CD tool that integrates well with GitHub. You can set up Jenkins to listen for webhooks from your GitHub repository and trigger builds automatically. Here's a high-level overview of integrating Jenkins with GitHub:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install and configure Jenkins on your server or use a hosted Jenkins service.&lt;/li&gt;
&lt;li&gt;Create a new Jenkins job and configure it to pull code from your GitHub repository.&lt;/li&gt;
&lt;li&gt;Configure the job to execute build commands, run tests, and perform any other necessary tasks.&lt;/li&gt;
&lt;li&gt;Add a webhook to your GitHub repository, pointing to the Jenkins server, to trigger builds whenever changes are pushed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With Jenkins integrated with GitHub, you can automate your build and deployment processes and ensure that your application is continuously tested and deployed.&lt;/p&gt;
&lt;h2&gt;
  
  
  Project Management and Issue Tracking
&lt;/h2&gt;

&lt;p&gt;GitHub also provides robust project management and issue tracking capabilities. However, you may prefer to use other tools for project management, such as Jira or Trello. Thankfully, GitHub offers integrations to sync your GitHub issues with these external tools.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;1. Jira Integration&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If your team uses Jira for project management and issue tracking, you can integrate it with your GitHub repository. The integration allows you to link GitHub issues to Jira issues, enabling seamless collaboration between developers and project managers. To set up the Jira integration:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the Jira integration app from the GitHub Marketplace.&lt;/li&gt;
&lt;li&gt;Configure the integration by providing your Jira instance URL and authentication details.&lt;/li&gt;
&lt;li&gt;Link GitHub issues to Jira issues by mentioning the Jira issue key (e.g., PROJECT-123) in the GitHub issue.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The integration will automatically sync issue details, comments, and status changes between GitHub and Jira, ensuring that both platforms stay up to date.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;2. Trello Integration&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Trello is another popular project management tool that can be integrated with GitHub. The integration allows you to link GitHub issues to Trello cards, providing a visual representation of your project's progress. Here's how to set up the Trello integration:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the Trello Power-Up for GitHub from the Trello Power-Up directory.&lt;/li&gt;
&lt;li&gt;Authorize Trello to access your GitHub account and repositories.&lt;/li&gt;
&lt;li&gt;Add the GitHub Power-Up to your Trello board.&lt;/li&gt;
&lt;li&gt;Link GitHub issues to Trello cards by mentioning the GitHub issue URL in the Trello card's description or comments.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The integration will provide a summary of the linked GitHub issue on the Trello card, making it easy to track progress and collaborate on issues.&lt;/p&gt;
&lt;h2&gt;
  
  
  Chat and Communication Tools
&lt;/h2&gt;

&lt;p&gt;Collaboration and communication are vital for successful development projects. Integrating GitHub with chat and communication tools can streamline collaboration and ensure that everyone is on the same page.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;1. Slack Integration&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Slack is a popular team communication platform that can be integrated with GitHub. The integration allows you to receive notifications about GitHub activities, such as pull requests, issues, and deployments, directly in your Slack channels. To set up the Slack integration:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the GitHub app from the Slack App Directory.&lt;/li&gt;
&lt;li&gt;Authorize the GitHub app to access your GitHub repositories.&lt;/li&gt;
&lt;li&gt;Configure the integration by selecting the desired GitHub repositories and Slack channels.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once configured, you will receive real-time notifications in your Slack channels, keeping your team informed about the latest activities in your GitHub repositories.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;2. Microsoft Teams Integration&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If your team uses Microsoft Teams for collaboration, you can integrate it with GitHub as well. The integration allows you to receive notifications about GitHub activities in your Teams channels. Here's how to set up the Microsoft Teams integration:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the GitHub app from the Microsoft Teams App Store.&lt;/li&gt;
&lt;li&gt;Authorize the app to access your GitHub repositories.&lt;/li&gt;
&lt;li&gt;Configure the integration by selecting the desired GitHub repositories and Teams channels.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With the integration in place, your Teams channels will receive notifications about events such as pull requests, issue updates, and repository activities.&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Integrating GitHub with other tools can significantly improve your development workflow, automate tasks, and enhance collaboration. Whether it's setting up CI/CD pipelines, syncing project management tools, or integrating with chat and communication platforms, GitHub provides a range of options to seamlessly connect with external tools. Explore the integrations discussed in this blog post and find the ones that best suit your team's needs. Streamline your development process, improve collaboration, and take advantage of the rich ecosystem of tools available to enhance your GitHub experience.&lt;/p&gt;

&lt;p&gt;Thank you for reading and do let me know your thoughts in comments!&lt;/p&gt;

&lt;p&gt;Connect With Me :&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__615131"&gt;
    &lt;a href="/pratik_kale" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&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%2Fuser%2Fprofile_image%2F615131%2F28ea1033-f65a-483f-b3a3-865ebec49526.jpeg" alt="pratik_kale image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/pratik_kale"&gt;Pratik Kale&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/pratik_kale"&gt;Software Enginner @ Impulsive Web | Organizer @GDG Cloud Pune | Google DSC Lead '21 | Tech Geek 💻 | Learner 📔&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://pratikkale.in"&gt;Website&lt;/a&gt; | &lt;a href="https://twitter.com/pratikkalein"&gt;Twitter&lt;/a&gt; | &lt;a href="https://www.instagram.com/prato.grapher/"&gt;Instagram&lt;/a&gt; | &lt;a href="//mailto:ppvkale@gmail.com"&gt;Mail&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>githubactions</category>
    </item>
    <item>
      <title>Advanced Git Techniques</title>
      <dc:creator>Pratik Kale</dc:creator>
      <pubDate>Sun, 02 Jul 2023 18:45:00 +0000</pubDate>
      <link>https://dev.to/pratik_kale/advanced-git-techniques-20n8</link>
      <guid>https://dev.to/pratik_kale/advanced-git-techniques-20n8</guid>
      <description>&lt;p&gt;Welcome to the fifteenth blog of the series!&lt;/p&gt;

&lt;p&gt;Git is a powerful version control system that enables efficient collaboration and tracking of code changes. While Git offers a straightforward workflow for everyday use, there are advanced techniques that can further enhance your productivity and flexibility. In this blog post, we will explore some of these advanced Git techniques, including branch management, rebasing, cherry-picking, and interactive staging.&lt;/p&gt;

&lt;h2&gt;
  
  
  Branch Management
&lt;/h2&gt;

&lt;p&gt;Branching is a fundamental concept in Git that allows you to work on multiple code streams concurrently. Here are a few advanced techniques for managing branches:&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a New Branch
&lt;/h3&gt;

&lt;p&gt;To create a new branch, use the &lt;code&gt;git branch&lt;/code&gt; command followed by the branch name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch new-feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This creates a new branch named &lt;code&gt;new-feature&lt;/code&gt; based on the current branch you're on.&lt;/p&gt;
&lt;h3&gt;
  
  
  Switching Between Branches
&lt;/h3&gt;

&lt;p&gt;To switch to a different branch, use the &lt;code&gt;git checkout&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout new-feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This switches your working directory to the new-feature branch.&lt;/p&gt;
&lt;h3&gt;
  
  
  Deleting a Branch
&lt;/h3&gt;

&lt;p&gt;Once you've merged a branch or no longer need it, you can delete it using the &lt;code&gt;git branch -d&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-d&lt;/span&gt; new-feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Renaming a Branch
&lt;/h3&gt;

&lt;p&gt;To rename a branch, you can use the -m option with the git branch command:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-m&lt;/span&gt; new-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;Rebasing is a technique used to incorporate changes from one branch onto another branch. It allows you to maintain a clean and linear history. Here's an example:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout feature-branch
git rebase main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This rebases the &lt;code&gt;feature-branch&lt;/code&gt; onto the &lt;code&gt;main&lt;/code&gt; branch, applying the changes from &lt;code&gt;main&lt;/code&gt; on top of the &lt;code&gt;feature-branch&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Cherry-picking
&lt;/h2&gt;

&lt;p&gt;Cherry-picking is a technique that allows you to apply a specific commit from one branch onto another branch. Here's how you can do it:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout target-branch
git cherry-pick &amp;lt;commit-hash&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This applies the changes from the specified commit onto the &lt;code&gt;target-branch&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Interactive Staging
&lt;/h2&gt;

&lt;p&gt;Interactive staging allows you to selectively stage changes within a file, providing fine-grained control over what gets committed. Here's how to do it:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nt"&gt;-p&lt;/span&gt; &amp;lt;file-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This opens the interactive staging mode, which presents each change within the file. You can choose to stage or skip individual changes based on your requirements.&lt;/p&gt;
&lt;h2&gt;
  
  
  Git Reflog
&lt;/h2&gt;

&lt;p&gt;Git reflog is a powerful tool that allows you to view the history of branch references, including branches that have been deleted or modified. It can be helpful for recovering lost commits or branches. Use the following command to access the reflog:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reflog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Git Worktree
&lt;/h2&gt;

&lt;p&gt;Git worktree is a feature that allows you to work on multiple branches simultaneously without switching between directories. It's particularly useful when you need to make changes in one branch while keeping another branch's working directory intact. Here's how to use it:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git worktree add &amp;lt;path&amp;gt; &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This creates a new worktree at the specified path, linked to the given branch.&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;These advanced Git techniques empower you to streamline your workflow, manage branches effectively, and maintain a clean commit history. By mastering techniques such as branch management, rebasing, cherry-picking, interactive staging, and utilizing Git tools like reflog and worktree, you can take full advantage of Git's capabilities. Experiment with these techniques in your projects, and over time, you'll become a more proficient Git user, enabling smoother collaboration and efficient code management.&lt;/p&gt;

&lt;p&gt;Thank you for reading and do let me know your thoughts in comments!&lt;/p&gt;

&lt;p&gt;Connect With Me :&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__615131"&gt;
    &lt;a href="/pratik_kale" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&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%2Fuser%2Fprofile_image%2F615131%2F28ea1033-f65a-483f-b3a3-865ebec49526.jpeg" alt="pratik_kale image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/pratik_kale"&gt;Pratik Kale&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/pratik_kale"&gt;Software Enginner @ Impulsive Web | Organizer @GDG Cloud Pune | Google DSC Lead '21 | Tech Geek 💻 | Learner 📔&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://pratikkale.in"&gt;Website&lt;/a&gt; | &lt;a href="https://twitter.com/pratikkalein"&gt;Twitter&lt;/a&gt; | &lt;a href="https://www.instagram.com/prato.grapher/"&gt;Instagram&lt;/a&gt; | &lt;a href="//mailto:ppvkale@gmail.com"&gt;Mail&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>learning</category>
    </item>
    <item>
      <title>GitHub Actions: Automating Your Workflow</title>
      <dc:creator>Pratik Kale</dc:creator>
      <pubDate>Sun, 02 Jul 2023 17:51:06 +0000</pubDate>
      <link>https://dev.to/pratik_kale/github-actions-automating-your-workflow-5a29</link>
      <guid>https://dev.to/pratik_kale/github-actions-automating-your-workflow-5a29</guid>
      <description>&lt;p&gt;Welcome to the fourteenth blog of the serires!&lt;/p&gt;

&lt;p&gt;GitHub Actions is a powerful automation tool provided by GitHub that allows you to automate various tasks and workflows within your repositories. With GitHub Actions, you can build, test, and deploy your code automatically, saving time and ensuring consistent results. In this blog post, we will explore the capabilities of GitHub Actions, learn how to set up workflows, and showcase examples of common automation scenarios.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding GitHub Actions
&lt;/h2&gt;

&lt;p&gt;GitHub Actions allows you to define custom workflows using YAML files. A workflow consists of one or more jobs, and each job runs on a separate virtual environment called a runner. You can specify the events that trigger the workflow, such as push, pull request, or a scheduled time. Each job can execute a series of steps, which can include running commands, executing scripts, or invoking external actions.&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%2Fju48i5qly7i6exharh24.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%2Fju48i5qly7i6exharh24.png" alt="GitHub Actions" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a Workflow
&lt;/h2&gt;

&lt;p&gt;To create a GitHub Actions workflow, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to your GitHub repository's page.&lt;/li&gt;
&lt;li&gt;Click on the "Actions" tab.&lt;/li&gt;
&lt;li&gt;Click on the "Set up a workflow yourself" link or choose a pre-defined workflow template.&lt;/li&gt;
&lt;li&gt;GitHub will open a new file in the &lt;code&gt;.github/workflows&lt;/code&gt; directory. Provide a meaningful name for the workflow, such as &lt;code&gt;main.yml&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Define the workflow using YAML syntax.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let's take a look at a simple example of a workflow that runs on every push to the main branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;CI&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Checkout code&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build and test&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;npm install&lt;/span&gt;
          &lt;span class="s"&gt;npm run build&lt;/span&gt;
          &lt;span class="s"&gt;npm run test&lt;/span&gt;

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

&lt;/div&gt;


&lt;p&gt;In this example, the workflow is triggered by a push event on the main branch. The build job runs on an ubuntu-latest runner. The steps in the job include checking out the code and performing build and test operations.&lt;/p&gt;
&lt;h2&gt;
  
  
  Using Actions
&lt;/h2&gt;

&lt;p&gt;GitHub Actions provides a vast marketplace of pre-built actions that you can use in your workflows. Actions are reusable units of code that perform specific tasks. You can find actions for a wide range of use cases, such as deploying to cloud platforms, sending notifications, or running tests.&lt;/p&gt;

&lt;p&gt;To use an action in your workflow, you can specify it in the &lt;code&gt;steps&lt;/code&gt; section of a job. Here's an example that uses the &lt;code&gt;actions/checkout&lt;/code&gt; and &lt;code&gt;actions/npm actions&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Checkout code&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build and test&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;npm install&lt;/span&gt;
          &lt;span class="s"&gt;npm run build&lt;/span&gt;
          &lt;span class="s"&gt;npm run test&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy to GitHub Pages&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;JamesIves/github-pages-deploy-action@4.1.0&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;branch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gh-pages&lt;/span&gt;
          &lt;span class="na"&gt;folder&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dist&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In this example, after building and testing the code, the workflow uses the &lt;code&gt;JamesIves/github-pages-deploy-action action&lt;/code&gt; to deploy the contents of the &lt;code&gt;dist&lt;/code&gt; folder to the &lt;code&gt;gh-pages&lt;/code&gt; branch.&lt;/p&gt;
&lt;h2&gt;
  
  
  Secrets and Environment Variables
&lt;/h2&gt;

&lt;p&gt;GitHub Actions allows you to store and use secrets securely in your workflows. Secrets are encrypted and can be accessed within your workflow using environment variables.&lt;/p&gt;

&lt;p&gt;To set up a secret, go to your repository's page, click on "Settings," then "Secrets," and finally "New repository secret." You can then reference the secret in your workflow using the &lt;code&gt;secrets.&amp;lt;secret-name&amp;gt;&lt;/code&gt; syntax.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Set up environment&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" &amp;gt;&amp;gt; $GITHUB_ENV&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In this example, the &lt;code&gt;DATABASE_URL&lt;/code&gt; secret is set as an environment variable within the workflow.&lt;/p&gt;
&lt;h2&gt;
  
  
  Workflow Visualization
&lt;/h2&gt;

&lt;p&gt;GitHub provides a visual representation of your workflows, making it easier to understand the overall process and identify potential issues. You can access the workflow visualization by navigating to the "Actions" tab in your repository and selecting the workflow of interest.&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;GitHub Actions offers a powerful automation platform that allows you to streamline your development workflows. By defining custom workflows, leveraging pre-built actions, and utilizing secrets and environment variables, you can automate tasks such as building, testing, and deploying your code. Explore the vast marketplace of actions and experiment with different workflows to enhance your development process. GitHub Actions empowers you to save time, increase productivity, and ensure the consistency and quality of your software projects. Start automating your workflows with GitHub Actions today!&lt;/p&gt;

&lt;p&gt;Thank you for reading and do let me know your thoughts in comments!&lt;/p&gt;

&lt;p&gt;Connect With Me :&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__615131"&gt;
    &lt;a href="/pratik_kale" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&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%2Fuser%2Fprofile_image%2F615131%2F28ea1033-f65a-483f-b3a3-865ebec49526.jpeg" alt="pratik_kale image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/pratik_kale"&gt;Pratik Kale&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/pratik_kale"&gt;Software Enginner @ Impulsive Web | Organizer @GDG Cloud Pune | Google DSC Lead '21 | Tech Geek 💻 | Learner 📔&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://pratikkale.in"&gt;Website&lt;/a&gt; | &lt;a href="https://twitter.com/pratikkalein"&gt;Twitter&lt;/a&gt; | &lt;a href="https://www.instagram.com/prato.grapher/"&gt;Instagram&lt;/a&gt; | &lt;a href="//mailto:ppvkale@gmail.com"&gt;Mail&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>githubactions</category>
    </item>
    <item>
      <title>GitHub Desktop: Simplified Git Workflow</title>
      <dc:creator>Pratik Kale</dc:creator>
      <pubDate>Sun, 02 Jul 2023 17:28:22 +0000</pubDate>
      <link>https://dev.to/pratik_kale/github-desktop-simplified-git-workflow-3bhb</link>
      <guid>https://dev.to/pratik_kale/github-desktop-simplified-git-workflow-3bhb</guid>
      <description>&lt;p&gt;Welcome to the thirteenth blog of the series!&lt;/p&gt;

&lt;p&gt;GitHub Desktop is a user-friendly application that provides a graphical interface for managing your Git repositories. It simplifies the Git workflow by abstracting away the command-line complexity and providing an intuitive interface to perform common Git operations. In this blog post, we will explore the features of GitHub Desktop, demonstrate how to use them effectively, and showcase how it streamlines your Git workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing GitHub Desktop
&lt;/h2&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%2Fnmxncst60hmvos8arje3.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%2Fnmxncst60hmvos8arje3.png" alt="GitHub Desktop" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before we dive into the features of GitHub Desktop, let's quickly go over the installation process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Visit the GitHub Desktop website at desktop.github.com.&lt;/li&gt;
&lt;li&gt;Download the GitHub Desktop application compatible with your operating system.&lt;/li&gt;
&lt;li&gt;Run the installer and follow the on-screen instructions to complete the installation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once GitHub Desktop is installed, let's explore its powerful features.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloning a Repository
&lt;/h2&gt;

&lt;p&gt;To start working with GitHub Desktop, you need to clone an existing Git repository. Follow these steps to clone a repository:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Launch GitHub Desktop.&lt;/li&gt;
&lt;li&gt;Click on the "File" menu and select "Clone Repository."&lt;/li&gt;
&lt;li&gt;Choose the repository you want to clone from the list of available options.&lt;/li&gt;
&lt;li&gt;Specify the local path where you want to store the repository on your computer.&lt;/li&gt;
&lt;li&gt;Click on the "Clone" button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GitHub Desktop will download the repository to your local machine, allowing you to work with its files and history.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making Changes and Committing
&lt;/h2&gt;

&lt;p&gt;GitHub Desktop provides an intuitive interface for making changes to your code and committing them to the repository. Here's how to do it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the cloned repository in GitHub Desktop.&lt;/li&gt;
&lt;li&gt;Make changes to your code using your preferred code editor.&lt;/li&gt;
&lt;li&gt;Switch back to GitHub Desktop and you will see the changes listed under "Changes" tab.&lt;/li&gt;
&lt;li&gt;Review the changes and choose the files you want to include in the commit.&lt;/li&gt;
&lt;li&gt;Enter a descriptive commit message that explains the changes.&lt;/li&gt;
&lt;li&gt;Click on the "Commit" button to create a commit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GitHub Desktop will create a new commit with your changes and update the repository's history.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pushing and Pulling
&lt;/h2&gt;

&lt;p&gt;With GitHub Desktop, pushing and pulling changes to and from remote repositories becomes effortless. Here's how to do it:&lt;/p&gt;

&lt;h3&gt;
  
  
  Pushing Changes
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;After committing your changes, click on the "Push origin" button at the top right corner of the application.&lt;/li&gt;
&lt;li&gt;GitHub Desktop will push your local commits to the remote repository, keeping your local and remote repositories in sync.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Pulling Changes
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;If there are new changes in the remote repository, GitHub Desktop will notify you.&lt;/li&gt;
&lt;li&gt;Click on the "Pull origin" button to fetch and merge the latest changes from the remote repository into your local repository.&lt;/li&gt;
&lt;li&gt;
GitHub Desktop handles the complexities of pulling and pushing changes, making it easy to collaborate with others on your projects.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;GitHub Desktop simplifies the process of branching and merging in Git. Here's how to create a new branch and merge it back to the main branch:&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a New Branch
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Click on the current branch dropdown at the top left corner of the application.&lt;/li&gt;
&lt;li&gt;Select "New Branch" from the dropdown menu.&lt;/li&gt;
&lt;li&gt;Enter a name for your new branch.&lt;/li&gt;
&lt;li&gt;Click on the "Create Branch" button.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Merging Branches
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Switch to the branch you want to merge into (e.g., the main branch).&lt;/li&gt;
&lt;li&gt;Click on the "Branch" menu and select "Merge into current branch."&lt;/li&gt;
&lt;li&gt;Choose the branch you want to merge from the dropdown menu.&lt;/li&gt;
&lt;li&gt;Review the changes that will be merged and click on the "Merge Branch" button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GitHub Desktop streamlines the branching and merging process, allowing you to manage different versions of your code with ease.&lt;/p&gt;

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

&lt;p&gt;GitHub Desktop provides a user-friendly interface for managing your Git repositories. With its intuitive features, you can clone repositories, make changes, commit, push and pull changes, create branches, and merge them effortlessly. By abstracting away the complexities of the command line, GitHub Desktop simplifies the Git workflow and empowers developers to focus on their code and collaboration.&lt;/p&gt;

&lt;p&gt;Thank you for reading and do let me know your thoughts in comments!&lt;/p&gt;

&lt;p&gt;Connect With Me :&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__615131"&gt;
    &lt;a href="/pratik_kale" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&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%2Fuser%2Fprofile_image%2F615131%2F28ea1033-f65a-483f-b3a3-865ebec49526.jpeg" alt="pratik_kale image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/pratik_kale"&gt;Pratik Kale&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/pratik_kale"&gt;Software Enginner @ Impulsive Web | Organizer @GDG Cloud Pune | Google DSC Lead '21 | Tech Geek 💻 | Learner 📔&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
 &lt;br&gt;
&lt;a href="https://pratikkale.in"&gt;Website&lt;/a&gt; | &lt;a href="https://twitter.com/pratikkalein"&gt;Twitter&lt;/a&gt; | &lt;a href="https://www.instagram.com/prato.grapher/"&gt;Instagram&lt;/a&gt; | &lt;a href="//mailto:ppvkale@gmail.com"&gt;Mail&lt;/a&gt;

</description>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>GitKraken Client: Advanced Features</title>
      <dc:creator>Pratik Kale</dc:creator>
      <pubDate>Sun, 02 Jul 2023 17:14:42 +0000</pubDate>
      <link>https://dev.to/pratik_kale/gitkraken-client-advanced-features-5emi</link>
      <guid>https://dev.to/pratik_kale/gitkraken-client-advanced-features-5emi</guid>
      <description>&lt;p&gt;Welcome to the twelth blog of the series!&lt;/p&gt;

&lt;p&gt;GitKraken is a popular Git client that provides a visually appealing and user-friendly interface for managing your Git repositories. It offers a range of advanced features that can greatly enhance your Git workflow. In this blog post, we will explore some of the advanced features of GitKraken and demonstrate how to use them effectively.&lt;/p&gt;

&lt;p&gt;Refer to the previous blog for installation and overview of the basic features.&lt;/p&gt;

&lt;h2&gt;
  
  
  Visualizing Repository History
&lt;/h2&gt;

&lt;p&gt;One of the key advantages of GitKraken is its ability to visually represent the history of your Git repository. This makes it easier to understand and navigate through complex branching and merging structures. Here's how you can visualize your repository history in GitKraken:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Launch GitKraken.&lt;/li&gt;
&lt;li&gt;Click on "File" in the menu bar and select "Open Repository".&lt;/li&gt;
&lt;li&gt;Choose the local repository you want to visualize, or clone a remote repository.&lt;/li&gt;
&lt;li&gt;GitKraken will display the repository graph, showing branches, commits, and their relationships.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By visually representing your repository history, GitKraken helps you gain a better understanding of your codebase and its evolution over time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resolving Merge Conflicts
&lt;/h2&gt;

&lt;p&gt;Merge conflicts can occur when Git is unable to automatically merge changes from different branches. GitKraken provides a streamlined interface for resolving merge conflicts, making the process more intuitive. Follow these steps to resolve merge conflicts in GitKraken:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;When a merge conflict occurs, GitKraken will display a visual representation of the conflicting files with markers indicating the conflicts.&lt;/li&gt;
&lt;li&gt;Double-click on a file to open the merge conflict resolution view.&lt;/li&gt;
&lt;li&gt;GitKraken will present the conflicting sections of the file side by side, allowing you to manually edit and resolve the conflicts.&lt;/li&gt;
&lt;li&gt;Once you have resolved the conflicts, save the file.&lt;/li&gt;
&lt;li&gt;Click on the "Mark as resolved" button in the top-right corner of the merge conflict resolution view.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GitKraken will update the file and mark the conflict as resolved in the repository graph.&lt;/p&gt;

&lt;h2&gt;
  
  
  Working with Pull Requests
&lt;/h2&gt;

&lt;p&gt;GitKraken simplifies the process of creating and managing pull requests, making it easier to collaborate with your team. Here's how you can work with pull requests in GitKraken:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your repository in GitKraken.&lt;/li&gt;
&lt;li&gt;Click on the "Pull Requests" tab in the left sidebar.&lt;/li&gt;
&lt;li&gt;Click on the "New Pull Request" button.&lt;/li&gt;
&lt;li&gt;Select the source and target branches for the pull request.&lt;/li&gt;
&lt;li&gt;Add a title and description for the pull request.&lt;/li&gt;
&lt;li&gt;Optionally, assign reviewers and add labels to provide more context.&lt;/li&gt;
&lt;li&gt;Click on the "Create Pull Request" button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GitKraken will create the pull request and display it in the pull request list. You can view and manage your pull requests directly within GitKraken.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrating with Issue Tracking Systems
&lt;/h2&gt;

&lt;p&gt;GitKraken offers seamless integration with popular issue tracking systems such as Jira, GitHub Issues, and GitLab Issues. This integration allows you to view and manage your project's issues and track their progress without leaving the GitKraken interface. Here's how you can integrate GitKraken with an issue tracking system:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your repository in GitKraken.&lt;/li&gt;
&lt;li&gt;Click on the "Issue Tracking" tab in the left sidebar.&lt;/li&gt;
&lt;li&gt;Select the issue tracking system you want to integrate with.&lt;/li&gt;
&lt;li&gt;Follow the prompts to authenticate and connect GitKraken to your chosen system.&lt;/li&gt;
&lt;li&gt;Once connected, you will be able to view and manage issues directly within GitKraken.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Integrating GitKraken with an issue tracking system streamlines your development workflow by providing a centralized view of issues and their related code changes.&lt;/p&gt;

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

&lt;p&gt;GitKraken is a feature-rich Git client that offers a range of advanced features to enhance your Git workflow. By visualizing repository history, resolving merge conflicts, working with pull requests, and integrating with issue tracking systems, GitKraken provides a comprehensive and user-friendly interface for managing your Git repositories. Install GitKraken today and leverage its advanced features to streamline your development process and collaborate more efficiently with your team.&lt;/p&gt;

&lt;p&gt;Thank you for reading and do let me know your thoughts in comments!&lt;/p&gt;

&lt;p&gt;Connect With Me :&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__615131"&gt;
    &lt;a href="/pratik_kale" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&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%2Fuser%2Fprofile_image%2F615131%2F28ea1033-f65a-483f-b3a3-865ebec49526.jpeg" alt="pratik_kale image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/pratik_kale"&gt;Pratik Kale&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/pratik_kale"&gt;Software Enginner @ Impulsive Web | Organizer @GDG Cloud Pune | Google DSC Lead '21 | Tech Geek 💻 | Learner 📔&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
 &lt;br&gt;
&lt;a href="https://pratikkale.in"&gt;Website&lt;/a&gt; | &lt;a href="https://twitter.com/pratikkalein"&gt;Twitter&lt;/a&gt; | &lt;a href="https://www.instagram.com/prato.grapher/"&gt;Instagram&lt;/a&gt; | &lt;a href="//mailto:ppvkale@gmail.com"&gt;Mail&lt;/a&gt;

</description>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>GitKraken Client: Getting Started</title>
      <dc:creator>Pratik Kale</dc:creator>
      <pubDate>Sun, 02 Jul 2023 17:00:27 +0000</pubDate>
      <link>https://dev.to/pratik_kale/gitkraken-client-getting-started-25mi</link>
      <guid>https://dev.to/pratik_kale/gitkraken-client-getting-started-25mi</guid>
      <description>&lt;p&gt;Welcome to the eleventh blog of the series!&lt;/p&gt;

&lt;p&gt;In this blog we will explore GitKraken Client.GitKraken is a powerful cross-platform Git client that provides an intuitive and visually appealing interface for managing your Git repositories. With features like seamless Git integration, a robust code editor, and collaborative tools, GitKraken simplifies the Git workflow and enhances productivity. In this blog post, we will guide you through getting started with GitKraken, explore its key features, and discuss some of the pro features available.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing GitKraken
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.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%2F8a0pp3kz5kw4lgwajdd6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F8a0pp3kz5kw4lgwajdd6.png" alt="GitKraken"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get started with GitKraken, follow these steps to install it on your machine:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Visit the GitKraken website at &lt;a href="//gitkraken.com"&gt;gitkraken.com&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Click on the "Download" button to download the installer for your operating system (Windows, macOS, or Linux).&lt;/li&gt;
&lt;li&gt;Run the installer and follow the on-screen instructions to complete the installation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once GitKraken is installed, launch the application to begin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloning a Repository
&lt;/h2&gt;

&lt;p&gt;To start working with a Git repository in GitKraken, you can clone an existing repository from a remote server. Follow these steps to clone a repository:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on the "Clone a Repo" button on the GitKraken home screen.&lt;/li&gt;
&lt;li&gt;Enter the URL of the remote repository you want to clone.&lt;/li&gt;
&lt;li&gt;Choose a local directory where you want to store the cloned repository.&lt;/li&gt;
&lt;li&gt;Click on the "Clone the repo!" button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GitKraken will clone the repository to your local machine, allowing you to start working with its files and history.&lt;/p&gt;

&lt;h2&gt;
  
  
  Navigating the Interface
&lt;/h2&gt;

&lt;p&gt;Once you have a repository open in GitKraken, you will notice its intuitive and user-friendly interface. Here are some key elements of the interface:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Commit graph&lt;/strong&gt;: The commit graph visually represents the commit history of the repository, showing branches, merges, and commits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File tree&lt;/strong&gt;: The file tree displays the directory structure of the repository, allowing you to navigate and manage files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diff view&lt;/strong&gt;: The diff view shows the differences between file versions, highlighting added, modified, and deleted lines.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Branches&lt;/strong&gt;: The branches panel lists all the branches in the repository, allowing you to create, switch, and merge branches.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pull request and issue integration&lt;/strong&gt;: GitKraken seamlessly integrates with popular hosting services like GitHub and GitLab, providing a streamlined experience for managing pull requests and issues.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Committing Changes
&lt;/h2&gt;

&lt;p&gt;To commit changes to your repository in GitKraken, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Make changes to your files in the code editor or any other external editor.&lt;/li&gt;
&lt;li&gt;In the GitKraken interface, stage the files you want to include in the commit by clicking on the checkbox next to each file.&lt;/li&gt;
&lt;li&gt;Enter a commit message that describes the changes you made.&lt;/li&gt;
&lt;li&gt;Click on the "Commit" button to create the commit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GitKraken will create a new commit with your changes and update the commit graph accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pro Features of GitKraken
&lt;/h2&gt;

&lt;p&gt;GitKraken offers additional advanced features through its pro version. Some of the notable pro features include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitKraken Boards&lt;/strong&gt;: A powerful kanban-style task and issue tracking system to manage your development projects seamlessly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitKraken Timelines&lt;/strong&gt;: A visual timeline that provides a clear overview of your repository's commit history and helps identify trends and patterns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitKraken Git Integration&lt;/strong&gt;: Deep integrations with popular development tools like Jira, Trello, Slack, and more, enabling smooth collaboration and project management.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To unlock the pro version you can use the GitHub Student Developer Pack. GitKraken is free as long as you are student.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Faku0tijyhbcb56w84p5e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Faku0tijyhbcb56w84p5e.png" alt="GitKraken"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;GitKraken is an exceptional Git client that offers a visually appealing and user-friendly interface for managing your Git repositories. By following the steps outlined in this blog post, you can get started with GitKraken, clone repositories, navigate the interface, and commit changes to your codebase. The pro features of GitKraken, including GitKraken Boards, Timelines, and Git Integration, further enhance your productivity and collaboration capabilities. Download GitKraken today and experience the power and simplicity it brings to your Git workflow.&lt;/p&gt;

&lt;p&gt;Thank you for reading and do let me know your thoughts in comments!&lt;/p&gt;

&lt;p&gt;Connect With Me :&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__615131"&gt;
    &lt;a href="/pratik_kale" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F615131%2F28ea1033-f65a-483f-b3a3-865ebec49526.jpeg" alt="pratik_kale image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/pratik_kale"&gt;Pratik Kale&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/pratik_kale"&gt;Software Enginner @ Impulsive Web | Organizer @GDG Cloud Pune | Google DSC Lead '21 | Tech Geek 💻 | Learner 📔&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
 &lt;br&gt;
&lt;a href="https://pratikkale.in" rel="noopener noreferrer"&gt;Website&lt;/a&gt; | &lt;a href="https://twitter.com/pratikkalein" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; | &lt;a href="https://www.instagram.com/prato.grapher/" rel="noopener noreferrer"&gt;Instagram&lt;/a&gt; | &lt;a href="//mailto:ppvkale@gmail.com"&gt;Mail&lt;/a&gt;

</description>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>Git Lens: Advanced Git Features</title>
      <dc:creator>Pratik Kale</dc:creator>
      <pubDate>Sun, 02 Jul 2023 16:36:41 +0000</pubDate>
      <link>https://dev.to/pratik_kale/git-lens-advanced-git-features-1mac</link>
      <guid>https://dev.to/pratik_kale/git-lens-advanced-git-features-1mac</guid>
      <description>&lt;p&gt;Welcome to the tenth blog of the series!&lt;br&gt;
Now that we have covered Git, GitHub and how to collborate. Let's look at Git Lens a Visual Studio extention which enhances your Git workflow by providing advanced features and insights directly within the editor. It offers a wealth of functionalities, including annotations, code lens, blame annotations, and much more. In this blog post, we will explore the various features of Git Lens, demonstrate how to use them effectively, and discuss some of the pro features available.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Git Lens
&lt;/h2&gt;

&lt;p&gt;Before we dive into the features of Git Lens, let's quickly go over the installation process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Launch Visual Studio Code.&lt;/li&gt;
&lt;li&gt;Open the Extensions view by clicking on the square icon on the left sidebar or by using the shortcut &lt;code&gt;Ctrl+Shift+X&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Search for "Git Lens - Git supercharged" in the Extensions Marketplace.&lt;/li&gt;
&lt;li&gt;Click on the "Install" button next to the Git Lens .&lt;/li&gt;
&lt;li&gt;Wait for the installation to complete, and then click on the "Reload" button to activate the extension.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With Git Lens installed and activated, let's explore its powerful features.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Flcbk44ody9uly7rcon03.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Flcbk44ody9uly7rcon03.png" alt="Git Lens"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Annotating Code with Git Blame
&lt;/h2&gt;

&lt;p&gt;Git Lens allows you to view Git blame annotations directly in your code, providing insights into who last modified each line. To enable Git blame annotations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open a file in Visual Studio Code.&lt;/li&gt;
&lt;li&gt;Right-click on the editor or use the command palette (Ctrl+Shift+P).&lt;/li&gt;
&lt;li&gt;Search for "Git Lens: Toggle Line Blame Annotations" and select it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Git Lens will display annotations alongside each line of code, showing the author and commit details.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exploring Code History
&lt;/h2&gt;

&lt;p&gt;With Git Lens, you can effortlessly explore the history of a file, view commits, and see detailed information about each commit. Follow these steps to access code history:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open a file in Visual Studio Code.&lt;/li&gt;
&lt;li&gt;Right-click on the editor or use the command palette (Ctrl+Shift+P).&lt;/li&gt;
&lt;li&gt;Search for "Git Lens: Show File History" and select it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Git Lens will display a timeline of commits related to the file. Clicking on a commit will show you the commit message, author, and other relevant information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Viewing Code Lens
&lt;/h2&gt;

&lt;p&gt;Code Lens is a powerful feature of Git Lens that provides additional contextual information about your code. It displays Git blame annotations, recent commit messages, and the number of references to a particular code block. To enable code lens:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open a file in Visual Studio Code.&lt;/li&gt;
&lt;li&gt;Look for annotations above code blocks, showing Git blame information and commit details.&lt;/li&gt;
&lt;li&gt;Hovering over the annotations will reveal additional options, such as viewing the full commit message or navigating to the commit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Code Lens provides valuable insights into the origin and history of your code, helping you understand its context and evolution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pro Features of Git Lens
&lt;/h2&gt;

&lt;p&gt;Git Lens offers additional advanced features through its pro version. Some of the notable pro features include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Code authorship&lt;/strong&gt;: See author statistics, including lines of code contributed and number of commits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advanced search&lt;/strong&gt;: Perform advanced searches within your Git repository, such as searching for specific code snippets or commit messages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File comparisons&lt;/strong&gt;: Compare the differences between different versions of a file to gain a deeper understanding of code changes.
To unlock these pro features, you can purchase a license directly within the extension.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To unlock the pro version you can use the GitHub Student Developer Pack. Git Lens pro is free as long as you are student.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F6mxobo8hoplitouqn1or.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F6mxobo8hoplitouqn1or.png" alt="Git Lens"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Git Lens is a valuable extension for Visual Studio Code that enhances your Git workflow and provides advanced features directly within the editor. With Git blame annotations, code history exploration, and code lens, you gain insights into the evolution and context of your code. The pro features of Git Lens offer additional capabilities, including code authorship statistics, advanced search functionality, and file comparisons. Install Git Lens today and take advantage of its powerful features to streamline your Git workflow and gain a deeper understanding of your codebase.&lt;/p&gt;

&lt;p&gt;Thank you for reading and do let me know your thoughts in comments!&lt;/p&gt;

&lt;p&gt;Connect With Me :&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__615131"&gt;
    &lt;a href="/pratik_kale" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F615131%2F28ea1033-f65a-483f-b3a3-865ebec49526.jpeg" alt="pratik_kale image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/pratik_kale"&gt;Pratik Kale&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/pratik_kale"&gt;Software Enginner @ Impulsive Web | Organizer @GDG Cloud Pune | Google DSC Lead '21 | Tech Geek 💻 | Learner 📔&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
 &lt;br&gt;
&lt;a href="https://pratikkale.in" rel="noopener noreferrer"&gt;Website&lt;/a&gt; | &lt;a href="https://twitter.com/pratikkalein" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; | &lt;a href="https://www.instagram.com/prato.grapher/" rel="noopener noreferrer"&gt;Instagram&lt;/a&gt; | &lt;a href="//mailto:ppvkale@gmail.com"&gt;Mail&lt;/a&gt;

</description>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>GitHub Pages: Custom Domains and SSL</title>
      <dc:creator>Pratik Kale</dc:creator>
      <pubDate>Sun, 02 Jul 2023 14:10:45 +0000</pubDate>
      <link>https://dev.to/pratik_kale/github-pages-custom-domains-and-ssl-mc4</link>
      <guid>https://dev.to/pratik_kale/github-pages-custom-domains-and-ssl-mc4</guid>
      <description>&lt;p&gt;Welcome to the ninth blog of the series!&lt;br&gt;
In the last blog we created our first website with GitHub Pages.&lt;br&gt;
It was deployed on the domain .github.io, but did you know that you can use a custom domain name for your GitHub Pages site? In addition, you can secure your website with SSL (Secure Sockets Layer) to ensure a safe and encrypted connection. In this blog post, we will explore how to set up a custom domain and enable SSL for your GitHub Pages site.&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we begin, make sure you have the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A GitHub account. You can create one for free at github.com.&lt;/li&gt;
&lt;li&gt;A registered domain name from a domain registrar (e.g., Namecheap, GoDaddy).&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Setting Up a Custom Domain
&lt;/h2&gt;

&lt;p&gt;To use a custom domain name for your GitHub Pages site, follow these steps:&lt;/p&gt;

&lt;p&gt;GitHub Pages: Custom Domains and SSL&lt;br&gt;
GitHub Pages provides a convenient way to host your static websites, but did you know that you can use a custom domain name for your GitHub Pages site? In addition, you can secure your website with SSL (Secure Sockets Layer) to ensure a safe and encrypted connection. In this blog post, we will explore how to set up a custom domain and enable SSL for your GitHub Pages site.&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we begin, make sure you have the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A GitHub account. You can create one for free at github.com.&lt;/li&gt;
&lt;li&gt;A registered domain name from a domain registrar (e.g., Namecheap, GoDaddy).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To register your domain you can use the free domain TLD's available from the GitHub Student Developer Pack. For more information you can refer the blog below.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="/pratik_kale" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F615131%2F28ea1033-f65a-483f-b3a3-865ebec49526.jpeg" alt="pratik_kale"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/pratik_kale/github-student-developer-pack-overview-1jld" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;GitHub Student Developer Pack: Overview&lt;/h2&gt;
      &lt;h3&gt;Pratik Kale ・ Jul 1 '23&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#github&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#community&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#writing&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Setting Up a Custom Domain
&lt;/h2&gt;

&lt;p&gt;To use a custom domain name for your GitHub Pages site, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your domain registrar's website and locate the DNS management settings for your domain.&lt;/li&gt;
&lt;li&gt;Add a CNAME record for your custom domain. The CNAME value should be &lt;code&gt;&amp;lt;your-username&amp;gt;.github.io&lt;/code&gt;, where &lt;code&gt;&amp;lt;your-username&amp;gt;&lt;/code&gt; is your GitHub username.&lt;/li&gt;
&lt;li&gt;Save the DNS changes and wait for the DNS propagation to take effect. This may take some time, usually up to 24 hours.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once the DNS changes have propagated, you can proceed with configuring your GitHub repository to use the custom domain.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to your GitHub repository's page.&lt;/li&gt;
&lt;li&gt;Click on the "Settings" tab.&lt;/li&gt;
&lt;li&gt;Scroll down to the "GitHub Pages" section.&lt;/li&gt;
&lt;li&gt;In the "Custom domain" field, enter your custom domain name (e.g., &lt;a href="http://www.yourdomain.com" rel="noopener noreferrer"&gt;www.yourdomain.com&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Click on the "Save" button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GitHub Pages will automatically configure the necessary settings to associate your custom domain with your repository. You can now access your GitHub Pages site using your custom domain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enabling SSL for Custom Domains
&lt;/h2&gt;

&lt;p&gt;Enabling SSL (Secure Sockets Layer) for your custom domain ensures that your website is accessed securely over HTTPS. To enable SSL for your GitHub Pages site, you can use a service like &lt;a href="https://www.cloudflare.com/" rel="noopener noreferrer"&gt;Cloudflare &lt;/a&gt; or &lt;a href="https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site" rel="noopener noreferrer"&gt;GitHub's Automated Certificate Management (ACM)&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using Cloudflare for SSL
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Sign up for a Cloudflare account.&lt;/li&gt;
&lt;li&gt;Add your custom domain to Cloudflare and follow their instructions to set up your DNS.&lt;/li&gt;
&lt;li&gt;Once your custom domain is set up on Cloudflare, go to the "SSL/TLS" section.&lt;/li&gt;
&lt;li&gt;Choose the SSL/TLS encryption mode to "Full" or "Full (Strict)".&lt;/li&gt;
&lt;li&gt;Cloudflare will automatically provide an SSL certificate for your domain.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Using GitHub's Automated Certificate Management (ACM)
&lt;/h3&gt;

&lt;p&gt;GitHub's ACM provides a simple way to enable SSL for your custom domain directly through your GitHub repository settings. Here's how to enable it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to your GitHub repository's page.&lt;/li&gt;
&lt;li&gt;Click on the "Settings" tab.&lt;/li&gt;
&lt;li&gt;Scroll down to the "GitHub Pages" section.&lt;/li&gt;
&lt;li&gt;In the "Custom domain" field, enter your custom domain name (e.g., &lt;a href="http://www.yourdomain.com" rel="noopener noreferrer"&gt;www.yourdomain.com&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Click on the "Enforce HTTPS" checkbox.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GitHub will automatically generate and manage an SSL certificate for your custom domain, allowing your site to be accessed securely over HTTPS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verifying SSL
&lt;/h2&gt;

&lt;p&gt;To verify that SSL is enabled for your custom domain, you can visit your website using the HTTPS protocol. For example, enter &lt;a href="https://www.yourdomain.com" rel="noopener noreferrer"&gt;https://www.yourdomain.com&lt;/a&gt; in your web browser. If the website loads without any security warnings, SSL is successfully enabled.&lt;/p&gt;

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

&lt;p&gt;Setting up a custom domain and enabling SSL for your GitHub Pages site can significantly enhance its professional appearance and security. By following the steps outlined in this blog post, you can easily configure your custom domain and ensure secure access to your website. Whether you're showcasing a personal portfolio or hosting a project website, custom domains and SSL provide a seamless and secure experience for your visitors. Start leveraging the power of custom domains and SSL with GitHub Pages and elevate your online presence!&lt;/p&gt;

&lt;p&gt;Thank you for reading and do let me know your thoughts in comments!&lt;/p&gt;

&lt;p&gt;Connect With Me :&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__615131"&gt;
    &lt;a href="/pratik_kale" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F615131%2F28ea1033-f65a-483f-b3a3-865ebec49526.jpeg" alt="pratik_kale image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/pratik_kale"&gt;Pratik Kale&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/pratik_kale"&gt;Software Enginner @ Impulsive Web | Organizer @GDG Cloud Pune | Google DSC Lead '21 | Tech Geek 💻 | Learner 📔&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
 &lt;br&gt;
&lt;a href="https://pratikkale.in" rel="noopener noreferrer"&gt;Website&lt;/a&gt; | &lt;a href="https://twitter.com/pratikkalein" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; | &lt;a href="https://www.instagram.com/prato.grapher/" rel="noopener noreferrer"&gt;Instagram&lt;/a&gt; | &lt;a href="//mailto:ppvkale@gmail.com"&gt;Mail&lt;/a&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>security</category>
    </item>
    <item>
      <title>GitHub Pages: Building Your First Website</title>
      <dc:creator>Pratik Kale</dc:creator>
      <pubDate>Sun, 02 Jul 2023 13:47:55 +0000</pubDate>
      <link>https://dev.to/pratik_kale/github-pages-building-your-first-website-4102</link>
      <guid>https://dev.to/pratik_kale/github-pages-building-your-first-website-4102</guid>
      <description>&lt;p&gt;Welcome to the eighth blog of the series!&lt;br&gt;
Now that we have a basic idea of Git &amp;amp; GitHub let's use is it in a real world scenario. In this blog we will explore GitHub Pages and see how you can build and host a simple portfolio website.&lt;/p&gt;

&lt;p&gt;In today's digital age, having a personal website has become more than just a trend; it's a necessity. Whether you're an aspiring entrepreneur, a creative professional, or even a job seeker, a personal website can serve as your online identity and give you a competitive edge in the virtual realm. It's a place where you can showcase your skills, share your achievements, and connect with like-minded individuals from around the world. &lt;/p&gt;

&lt;p&gt;GitHub Pages makes it very easy to host a static website with a few click!&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;A GitHub account. You can create one for free at github.com.&lt;/li&gt;
&lt;li&gt;Basic knowledge of HTML, CSS, and Git.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Setting Up a Repository
&lt;/h2&gt;

&lt;p&gt;To get started with GitHub Pages, you need a repository to host your website. Follow these steps to create a new repository:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your GitHub account and click on the "+" button at the top right corner of the page.&lt;/li&gt;
&lt;li&gt;Select "New repository" from the dropdown menu.&lt;/li&gt;
&lt;li&gt;Choose a repository name. For GitHub Pages, it's recommended to name it .github.io, where  is your GitHub username.&lt;/li&gt;
&lt;li&gt;Optionally, add a description for your repository.&lt;/li&gt;
&lt;li&gt;Select "Public"&lt;/li&gt;
&lt;li&gt;Check the box to initialize the repository with a README file.&lt;/li&gt;
&lt;li&gt;Click on the "Create repository" button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Congratulations! You have created a new repository for your website. &lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Your Website
&lt;/h2&gt;

&lt;p&gt;Now that you have a repository, it's time to create your website. Follow these steps to get started:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your preferred code editor and create a new HTML file named index.html.&lt;/li&gt;
&lt;li&gt;Add the basic structure of an HTML file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Your Website Title&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- Your website content goes here --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;

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

&lt;/div&gt;


&lt;p&gt;I have given an example of &lt;code&gt;index.html&lt;/code&gt; file. But you can write code according to your linking and create a portofolio. You can also use templates which are readily available. You can refer the link below for few such examples.&lt;br&gt;
&lt;a href="https://html5up.net/"&gt;https://html5up.net/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also you can use themes offered by GitHub.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In your repository's settings, under the GitHub Pages section, click on the "Change theme" button.&lt;/li&gt;
&lt;li&gt;Browse through the available themes and select one that suits your website.&lt;/li&gt;
&lt;li&gt;Customize the theme settings, such as color scheme or layout, if desired.&lt;/li&gt;
&lt;li&gt;Your website will automatically update with the new theme.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Deploying Your Website with GitHub Pages
&lt;/h2&gt;

&lt;p&gt;With your website code ready, it's time to deploy it using GitHub Pages. Follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to your repository's page on GitHub.&lt;/li&gt;
&lt;li&gt;Click on the "Settings" tab.&lt;/li&gt;
&lt;li&gt;Scroll down to the "GitHub Pages" section.&lt;/li&gt;
&lt;li&gt;Select the branch you want to use for GitHub Pages. Typically, you should choose the &lt;code&gt;main&lt;/code&gt; branch.&lt;/li&gt;
&lt;li&gt;Optionally, choose a folder in your repository if your website files are located in a subdirectory.&lt;/li&gt;
&lt;li&gt;Click on the "Save" button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GitHub Pages will build and deploy your website. Once the process is complete, you will see a green success message with the URL of your deployed website. It may take a few moments for the changes to take effect.&lt;/p&gt;
&lt;h2&gt;
  
  
  Updating your website
&lt;/h2&gt;

&lt;p&gt;To update your website, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Make changes to your website's HTML, CSS, or other assets in your code editor.&lt;/li&gt;
&lt;li&gt;Save the changes.&lt;/li&gt;
&lt;li&gt;Commit and push the changes to your GitHub repository using Git commands or a Git client.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GitHub Pages will automatically rebuild and update your website with the latest changes.&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;GitHub Pages provides an excellent platform for hosting your static websites with ease. By following the steps outlined in this blog post, you can set up your repository, create your website, and deploy it using GitHub Pages. With customization options like custom domains and themes, you can personalize your website to reflect your style and brand. GitHub Pages is a powerful tool that empowers developers to showcase their projects, create personal websites, and share their work with the world. Start building your first website with GitHub Pages and take your web presence to new heights!&lt;/p&gt;

&lt;p&gt;Thank you for reading and do let me know your thoughts in comments!&lt;/p&gt;

&lt;p&gt;Connect With Me :&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__615131"&gt;
    &lt;a href="/pratik_kale" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&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%2Fuser%2Fprofile_image%2F615131%2F28ea1033-f65a-483f-b3a3-865ebec49526.jpeg" alt="pratik_kale image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/pratik_kale"&gt;Pratik Kale&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/pratik_kale"&gt;Software Enginner @ Impulsive Web | Organizer @GDG Cloud Pune | Google DSC Lead '21 | Tech Geek 💻 | Learner 📔&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://pratikkale.in"&gt;Website&lt;/a&gt; | &lt;a href="https://twitter.com/pratikkalein"&gt;Twitter&lt;/a&gt; | &lt;a href="https://www.instagram.com/prato.grapher/"&gt;Instagram&lt;/a&gt; | &lt;a href="//mailto:ppvkale@gmail.com"&gt;Mail&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>githubactions</category>
    </item>
  </channel>
</rss>
