<?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: Adil Shahzad</title>
    <description>The latest articles on DEV Community by Adil Shahzad (@adilshehzad786).</description>
    <link>https://dev.to/adilshehzad786</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%2F337840%2F8ecbe0f2-88a6-4c3a-a361-13a614ea37c3.jpeg</url>
      <title>DEV Community: Adil Shahzad</title>
      <link>https://dev.to/adilshehzad786</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adilshehzad786"/>
    <language>en</language>
    <item>
      <title>Managing Google Cloud using Infrastructure as Code (IaC)</title>
      <dc:creator>Adil Shahzad</dc:creator>
      <pubDate>Sun, 14 Jan 2024 17:00:19 +0000</pubDate>
      <link>https://dev.to/gdgcloudlahore_org/managing-google-cloud-using-infrastructure-as-code-iac-25pg</link>
      <guid>https://dev.to/gdgcloudlahore_org/managing-google-cloud-using-infrastructure-as-code-iac-25pg</guid>
      <description>&lt;h2&gt;
  
  
  Infrastructure as Code
&lt;/h2&gt;

&lt;p&gt;Infrastructure as Code (IaC) is a method used to manage and set up computer networks, servers, and other IT infrastructure through machine-readable files, rather than physical hardware configuration or interactive configuration tools. To understand it easily, think of it like building a model house using LEGO blocks. In traditional methods (like building a house by hand), you would manually place each brick. But with IaC, you create a blueprint or a plan that tells an automated system exactly how to build your model house. Whenever you want to build the house, you just use this plan, and the system automatically assembles the LEGO blocks as per your design.&lt;/p&gt;

&lt;p&gt;This approach makes the entire process of managing IT infrastructure more efficient, consistent, and error-free. You can easily modify the plan if you want to change something (like adding a room to your model house), and the system will adjust everything accordingly. It's like updating your LEGO blueprint, and the model updates itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding API
&lt;/h2&gt;

&lt;p&gt;API stands for Application Programming Interface. Imagine an API as a menu in a restaurant. The menu provides a list of dishes you can order, along with a description of each dish. When you specify which dish you want, the kitchen (the system) prepares the dish and serves it to you (the user). In this analogy, the menu is the API, the order is the request, and the dish that is served to you is the response.&lt;/p&gt;

&lt;p&gt;Now, when it comes to Google Cloud API, think of it as a specialized menu offered by a very advanced restaurant (Google Cloud). This restaurant offers a variety of dishes (services) like storing your data, running your website, or analyzing large amounts of information. Each dish/service is accessed through its part of the menu/API. So, when you ask for a specific service, like data storage, the Google Cloud kitchen works behind the scenes to provide you with that service.&lt;/p&gt;

&lt;p&gt;In simpler terms, APIs allow different software programs to communicate with each other. Google Cloud API, in particular, lets your software access the various services offered by Google Cloud, like storing files, processing data, or even running complex algorithms.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exploring Cloud Shell
&lt;/h2&gt;

&lt;p&gt;Google Cloud Shell provides a convenient, ready-to-use command-line environment for interacting with Google Cloud services without the hassle of setting up and maintaining a separate computer or server for these tasks.&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%2F8cg21vi7kpm5b21qapia.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%2F8cg21vi7kpm5b21qapia.png" alt="Google Cloud Shell"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Managing Version Controlling using Git
&lt;/h2&gt;

&lt;p&gt;Managing version control using Git is crucial for efficient collaboration in software development. Git allows multiple individuals to work on the same project without interfering with each other's changes. Here are the top git commands you can use , for more commands checkout here : &lt;a href="https://education.github.com/git-cheat-sheet-education.pdf" rel="noopener noreferrer"&gt;Git Cheatsheet&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;code&gt;git init&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Usage:&lt;/strong&gt; Initializes a new Git repository in your project directory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git init&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. &lt;code&gt;git status&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Usage:&lt;/strong&gt; Shows the status of changes as untracked, modified, or staged.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git status&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. &lt;code&gt;git add&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Usage:&lt;/strong&gt; Starts tracking new files and stages any changes to existing files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git add &amp;lt;filename&amp;gt;&lt;/code&gt; or &lt;code&gt;git add .&lt;/code&gt; (to add all files)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. &lt;code&gt;git commit&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Usage:&lt;/strong&gt; Records your changes as a commit with a descriptive message.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git commit -m "Commit message"&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. &lt;code&gt;git push&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Usage:&lt;/strong&gt; Pushes your commits to the remote repository.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git push -u origin master&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6. &lt;code&gt;git pull&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Usage:&lt;/strong&gt; Fetches and merges changes from the remote server to your local repository.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;git pull&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  GCP Deployment Manager
&lt;/h2&gt;

&lt;p&gt;Google Cloud Deployment Manager is a tool that lets you manage your Google Cloud resources using a declarative format. Here is the overview of how to write a Deployment Manager template file. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Specify the Template Version&lt;/strong&gt;: At the top of the file, you define the version of the template that you are using. This helps the Deployment Manager understand how to process the file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Resource Definitions:&lt;/strong&gt; Each resource you want to create, like a virtual machine or a storage bucket, is defined in a section called 'resources'. For each resource, you provide details such as:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Name:&lt;/strong&gt; A unique identifier for the resource.&lt;br&gt;
   &lt;strong&gt;Type:&lt;/strong&gt; The kind of resource you want to create, like a &lt;br&gt;
             compute engine instance or a Cloud SQL database.&lt;br&gt;
   &lt;strong&gt;Properties:&lt;/strong&gt; The specific settings for the resource. For &lt;br&gt;
                   a compute instance, this could include the &lt;br&gt;
                   machine type, the image to use, the network &lt;br&gt;
                   settings, and more.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Configuration Parameters (optional):&lt;/strong&gt; Sometimes, you might want to pass in parameters that can change, like the machine type or the zone you want to deploy to. You can define these parameters at the beginning of your file and reference them within your resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Outputs (optional):&lt;/strong&gt; After your resources are created, you might want to output certain information, like the IP address of a virtual machine. You can define outputs to retrieve this information after deployment.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the sample YAML template for Deployment Manager to create a virtual machine.&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;resources&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;my-vm&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;compute.v1.instance&lt;/span&gt;
  &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;zone&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;us-central1-a&lt;/span&gt;
    &lt;span class="na"&gt;machineType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;zones/us-central1-a/machineTypes/f1-micro&lt;/span&gt;
    &lt;span class="na"&gt;disks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;deviceName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;boot&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;PERSISTENT&lt;/span&gt;
        &lt;span class="na"&gt;boot&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="na"&gt;autoDelete&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="na"&gt;initializeParams&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;sourceImage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;projects/debian-cloud/global/images/family/debian-9&lt;/span&gt;
    &lt;span class="na"&gt;networkInterfaces&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;network&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;global/networks/default&lt;/span&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Lab
&lt;/h2&gt;

&lt;p&gt;First, access the Cloud Shell and ensure you have access to the project&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%2Fk9oj58qwrx3ogd4e3mxv.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%2Fk9oj58qwrx3ogd4e3mxv.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, from the terminal, type the following command to clone the repository&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/GDGCloudLahore/GCP-Deployment-Manager-IaC.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, navigate to the basic01 lab.&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%2F1uj76utafnzu5pve7qhk.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%2F1uj76utafnzu5pve7qhk.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, add the following command. The Google Cloud Shell will ask you for authorization&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud deployment-manager deployments create my-vm-deployment &lt;span class="nt"&gt;--config&lt;/span&gt; vm-deployment.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fhhe08yay2yjg1f6o003z.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%2Fhhe08yay2yjg1f6o003z.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"In case you face any issue or error, please open an issue on our &lt;a href="https://github.com/GDGCloudLahore/GCP-Deployment-Manager-IaC/issues" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;."&lt;/em&gt; &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%2Fclmuh2o1f5848xwwl54c.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%2Fclmuh2o1f5848xwwl54c.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After receiving a successful creation message, you are now able to view the compute resource.&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%2Fta98lo5g7d58rzeoxvsb.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%2Fta98lo5g7d58rzeoxvsb.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope you like this blog. We have many blogs in the pipeline that we are working on. You are welcome to contribute to our &lt;a href="https://github.com/GDGCloudLahore/GCP-Deployment-Manager-IaC.git" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt; if you have experience working with Deployment Manager. If you have any questions, please feel free to ask me on LinkedIn.&lt;/p&gt;

&lt;p&gt;This blog is written and managed by &lt;a href="https://www.linkedin.com/in/adilshehzad7/" rel="noopener noreferrer"&gt;Adil Shahzad&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Join our discussion room to ask questions from cloud experts : &lt;a href="https://www.googlecloudlahore.com/" rel="noopener noreferrer"&gt;https://www.googlecloudlahore.com/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>googlecloud</category>
      <category>iac</category>
      <category>infrastructureascode</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Git Cheat sheet for Beginners</title>
      <dc:creator>Adil Shahzad</dc:creator>
      <pubDate>Sat, 19 Mar 2022 06:32:57 +0000</pubDate>
      <link>https://dev.to/adilshehzad786/git-cheat-sheet-for-beginners-46b4</link>
      <guid>https://dev.to/adilshehzad786/git-cheat-sheet-for-beginners-46b4</guid>
      <description>&lt;p&gt;This Git cheat sheet saves you time when you just can't remember what a command is or don't want to use git help in the command line. It is hard to memorize all the important Git commands by heart, so this can help you when you get stuck.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git --version&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;To check the version of git&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;which git&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;See where Git is located&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git help&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;terminal-based documentation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;cd&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Navigate to the directories using terminal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;ls&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;list files and directories&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;ls -A&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;list hidden files and directories&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;mkdir&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Creating a new directory using terminal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;touch&lt;/strong&gt; readme.txt&lt;/td&gt;
&lt;td&gt;creating new file&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Git configuration
&lt;/h2&gt;

&lt;p&gt;Configuring user information used across all local repositories&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.name "First name last name"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.email "[valid-email"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Git basics
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git init&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;initialize an existing directory as a Git repository&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git status&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;show modified files in the working directory, staged for your next commit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git add [filename]&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Stage all changes in  for the next commit.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git commit -m "Describe Message"&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;commit your staged content as a new commit snapshot&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Branches
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git branch&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;List all branches&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git branch newbranch&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Create a new branch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git checkout newbranch&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;switch to another branch and check it out into your working directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git checkout -b newbranch&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Create and switch to new branch at the same time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git branch -m branchname new_branchname&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Renaming a branch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git branch -d branchname&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Delete merged branch (only possible if not HEAD)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git branch -D branch_to_delete&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Delete not merged branch&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Merge
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git merge branchname&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Merge the specified branch’s history into the current one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git merge --ff-only branchname&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Merge to master only if fast forward&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git merge --abort&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Stop merge in case of merge conflicts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git cherry-pick 073791e7&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Merge a Specific commit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git checkout branchname » git rebase master&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Rebase the current branch onto master&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git rebase --abort&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Cancel rebase&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git rebase -i HEAD~3&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Squash Multiple commits into one&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Git log
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git log&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;show all commits in the current branch’s history&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git log --oneline&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Show oneline-summary of commits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git log -p&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;show changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git log --stat --summary&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Show stats and summary of commit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git log --graph&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Show history of commits as graph&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git log --oneline --graph --all --decorate&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Show history of commits as graph-summary&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Compare
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git diff&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;To compare modified files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git diff --staged&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;To compare modified files within the staging area&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git diff master..branchname&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;To compare branches&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git diff 6eb715d&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Compare with the previous commit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git diff --ignore-space-change 6eb715d..HEAD&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;to compare without caring about spaces:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git diff --ignore-all-space 6eb715d..HEAD&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;To compare without caring about all spaces&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Make sure you replace this commit 6eb715d with your commit ID&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Stash
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git stash&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Save modified and staged changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git stash save "Message"&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Put in the stash with message&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git stash list&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;list stack-order of stashed file changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git stash show stash@{0}&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Show stash stats&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git stash pop&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;write working from the top of stash stack&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git stash branch new_branch&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Create branch from stash&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git stash drop&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;discard the changes from the top of stash stack&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Tags
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git tag&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Show all released versions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git tag -l -n1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Show all released versions with comments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git tag v1.0.0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Create release version&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git tag -a v1.0.0 -m "Message"&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Create release version with comment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git checkout v1.0.0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Checkout a specific release version&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Reset
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git revert 073791&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Go back to commit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git reset --soft 073791&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Soft reset (move HEAD only; neither staging nor working directory is changed)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git reset --soft HEAD~&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Undo the latest commit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Remote
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git remote add origin [repo-url]&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Adding remote origin to local repository&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git remote -v&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Show remote details&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git remote rm origin&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Remove origin&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git branch -M main&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Renaming a branch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git push -u origin master&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Push changes to the remote repository&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git pull&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Pulling changes from the remote repository&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git pull origin branchname&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Pull specific branch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git clone [repo-url]&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Cloning a local repository&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;git push origin --delete branchname&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Deleting branch from the remote origin&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
    </item>
    <item>
      <title>Understanding GitHub Workflow</title>
      <dc:creator>Adil Shahzad</dc:creator>
      <pubDate>Sat, 19 Mar 2022 06:32:08 +0000</pubDate>
      <link>https://dev.to/adilshehzad786/understanding-github-workflow-348i</link>
      <guid>https://dev.to/adilshehzad786/understanding-github-workflow-348i</guid>
      <description>&lt;p&gt;Previously, we have learned how to synchronize the local git repository with the Remote GitHub Repository to store the content history of the project on GitHub. In this lesson, we will learn how you can follow the GitHub flow to easily experiment with new ideas safely without the risk of compromising the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is GitHub flow?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;GitHub's flow&lt;/strong&gt; is a lightweight branch-based workflow. The GitHub workflow is helpful for everyone. With the help of GitHub flow, you can experiment on your repository.&lt;/p&gt;

&lt;p&gt;By Default, our project is on the &lt;strong&gt;main branch;&lt;/strong&gt; any changes made on the main branch will directly update the project. &lt;br&gt;
When we want to experiment with new features or even fix an issue, we can create a new branch on the project. The branch will duplicate the main branch and the changes reflected in the new branch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a branch
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open your repository and click the "Code" tab&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Branch: main&lt;/code&gt; in the drop-down&lt;/li&gt;
&lt;li&gt;In the field, enter a name for your branch (e.g., 'dev')&lt;/li&gt;
&lt;li&gt;Click Create branch.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OSU6IKxd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9mw5k4bzym3au11wzy7u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OSU6IKxd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9mw5k4bzym3au11wzy7u.png" alt="Git Workflow" width="800" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Committing a file
&lt;/h3&gt;

&lt;p&gt;Now that we are on the dev branch created earlier, you can create a new file or edit the file already in the dev branch.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;You can add the file from the &lt;code&gt;Add file&lt;/code&gt;, and from the dropdown, select the &lt;code&gt;create new file&lt;/code&gt; option or edit already existing files in the dev branch.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When you are done with changes, give the commit a name and description. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make sure your newly created (dev) branch is selected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on Commit changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You have made your first commit! The next step is to share the changes with your team via a pull request.&lt;/p&gt;

&lt;h3&gt;
  
  
  Open a Pull Request
&lt;/h3&gt;

&lt;p&gt;A pull request is where we share our proposed project changes with our team — with the intent of discussing &amp;amp; revising them before applying the changes to the main branch.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open the Pull requests tab and click on "New pull request."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the base: dropdown menu, ensure the main branch is selected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select the dev branch you created earlier in the compare: dropdown menu.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cA0gRdgh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r2gm80zmdwiak4sx9rkk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cA0gRdgh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r2gm80zmdwiak4sx9rkk.png" alt="Delete Branch" width="800" height="113"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After successfully merging the dev branch changes to the main branch, we can delete the dev branch by clicking on the delete branch button. &lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;In this lesson, we learned the &lt;strong&gt;git-flow&lt;/strong&gt; while adding features or fixing bugs in the project; with the help of git-flow, you can save your default branch and do experiments on the new branch. Practice the commands using the quiz and make sure you understand entirely Git &amp;amp; GitHub. You can access the Git cheat sheet, which helps you with the basic and advanced commands. When you are confident, you can go to the second module, in which we will get started with GitHub actions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/introducing-git-github-ida"&gt;Introducing Git &amp;amp; GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/all-about-git-github-beginner-to-advance-1061"&gt;Main Menu &lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>githubworkflow</category>
    </item>
    <item>
      <title>Introducing Git &amp; GitHub</title>
      <dc:creator>Adil Shahzad</dc:creator>
      <pubDate>Sat, 19 Mar 2022 06:05:51 +0000</pubDate>
      <link>https://dev.to/adilshehzad786/introducing-git-github-ida</link>
      <guid>https://dev.to/adilshehzad786/introducing-git-github-ida</guid>
      <description>&lt;p&gt;We have already covered git in advance, and now we are also familiar with GitHub and the features provided by GitHub. In this lesson, we will sync the local repository with GitHub; you will get a complete idea of how you can sync your local repository with the remote repository of GitHub.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's get started
&lt;/h2&gt;

&lt;p&gt;We have covered &lt;strong&gt;Git &amp;amp; GitHub&lt;/strong&gt; in detail. We learned that git is a Distributed Version Control System, and GitHub is a web-based git, version control repository and internet hosting service. Furthermore, we will learn how to synchronize the Local repository with GitHub in this lesson. &lt;/p&gt;

&lt;h3&gt;
  
  
  Creating local repository
&lt;/h3&gt;

&lt;p&gt;First, we need to create an empty directory. Use the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir &amp;lt;gitandgithub&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we need to Navigate to the Directory we created earlier with the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd &amp;lt;gitandgithub&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Git Init
&lt;/h3&gt;

&lt;p&gt;Now we created the Directory; we can initialize the git repository in the empty repository using the following command.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Remember that the command &lt;code&gt;ls -A&lt;/code&gt; is used to list the &lt;strong&gt;.git/&lt;/strong&gt; folder on the terminal because .git/ is the hidden file in the working directory.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C5aGhXa6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nemz5897y4zk6m90pdar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C5aGhXa6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nemz5897y4zk6m90pdar.png" alt="Git Init" width="800" height="162"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Git add
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Adding File Using Terminal
&lt;/h4&gt;

&lt;p&gt;We can create a file using the following command &lt;code&gt;touch index. html&lt;/code&gt; and edit the file through the terminal easily using the vim or nano editor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight viml"&gt;&lt;code&gt;&lt;span class="k"&gt;vi&lt;/span&gt; &lt;span class="nb"&gt;index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also read the text inside the file using the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Git status
&lt;/h4&gt;

&lt;p&gt;So files are now added to the Directory. Before we add the files to the staged area, firstly, we need to check the status of the git repository, which files are modified or deleted in the Directory, which can be checked using the &lt;code&gt;git status&lt;/code&gt; command. &lt;/p&gt;

&lt;h3&gt;
  
  
  Adding file to the staging area
&lt;/h3&gt;

&lt;p&gt;Now, we need to stage our files, which are added to the Directory, to track our files every time we modify, delete or add to the Directory. With the &lt;code&gt;git add .&lt;/code&gt; command, you can add your files to the staged area, and then with the help of the &lt;code&gt;git status&lt;/code&gt; command, you can check the status of your git local repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  Git commit
&lt;/h3&gt;

&lt;p&gt;When the files are in the staged area, you have committed on the files; when you make changes on the file, the commits history is created and can be accessed later using the command &lt;code&gt;git log&lt;/code&gt;. To Commit to the changes, you can use the following command.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;main.css file is also added to the Directory, which means the changes have been tracked in the git repository. To stage the changes, we can use the &lt;code&gt;git add .&lt;/code&gt; command, and to commit, we can use the command &lt;code&gt;git commit -m "Adding main.css&lt;/code&gt; file. Whenever you modify, delete or change the file or folder, you need to repeat this process and check the status of the git repository. You can use the command &lt;code&gt;git status&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Git branch
&lt;/h3&gt;

&lt;p&gt;As we have already discussed the concepts of the branches in detail, here we need to rename the master branch to the main branch because Github's new repositories are pushed to the main branch. Use the following command to rename the master branch to the main branch.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating a new GitHub repository
&lt;/h3&gt;

&lt;p&gt;You'll need to find a "+" sign at the top right of your GitHub account to get this started. The profile tab is next to it. Click the profile, and you will see a dropdown with the first option to create a "New repository." Once clicked, you will be redirected to another page where you will have to set certain information regarding your project, such as providing your repository's name, adding a description of the project, and declaring the repository as public. Do not select the README file and License. We will create these files later on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gl6NuWQF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r42jydgrlre1qshqlhyq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gl6NuWQF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r42jydgrlre1qshqlhyq.png" alt="GitHub Repo" width="800" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you follow the above image, you will redirect to the manual, which might be useful for the beginner.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PSE3RA44--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qyeq24y1x0r59lysoxv4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PSE3RA44--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qyeq24y1x0r59lysoxv4.png" alt="Git Repo" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Git Remote
&lt;/h3&gt;

&lt;p&gt;Now, let's go back to the local repository where we created the index.html file and main.css file; in the git bash terminal, we need to add the GitHub repository which we have created earlier; with the following command, you can add the remote repository to the local git repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add origin &amp;lt;GitHub REPO URL&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To get the GitHub Repository URL, you need to go to your repository created earlier, and by clicking on the Code button, you will get the GitHub Repo URL.&lt;/p&gt;

&lt;p&gt;The command will look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add origin https://github.com/gitlearning892/gitlearning892.github.io.git

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

&lt;/div&gt;



&lt;p&gt;With the &lt;strong&gt;&lt;code&gt;git remote -v&lt;/code&gt;&lt;/strong&gt; command, you can check the remote origin is added to the local repository or not.&lt;/p&gt;

&lt;p&gt;If you accidentally add the wrong repository to your local repository, you can change the existing remote repository with the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote set-url origin &amp;lt;GitHUB REPO URL&amp;gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Git push
&lt;/h3&gt;

&lt;p&gt;The Git push command is used to upload local repository content to the remote repository. Pushing is how you can transfer commits from your local repository to a remote repository. Pushing can overwrite changes; cautions should be taken when pushing to the remote repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push -u origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Go to your repository and refresh it; you will see all of your local content now pushed to the Github repository.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A popup will come for the Github authentication. Click on Login using a browser and provide your credential to push all of your changes to the Github repository.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Git pull
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N3dHvJBK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/yoEqdx7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N3dHvJBK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/yoEqdx7.png" alt="Pull " width="800" height="455"&gt;&lt;/a&gt;&lt;br&gt;
The git &lt;strong&gt;pull command&lt;/strong&gt; is used to fetch and download content from a remote repository and immediately update the local repository to match the content.&lt;br&gt;
&lt;strong&gt;For example,&lt;/strong&gt; If someone from your team made some changes in a file or created some file on a remote repository. A developer created a file named user.txt, but you don't know the changes made on the remote repository. Let's say you have created another file named team.txt. After you commit the file and try to push that file to your remote repository, git will not allow you to push your code because the remote repository contains work that you do not have locally. So, In this case, the git pull command is used to fetch and download content from a remote repo to a local repo.&lt;/p&gt;

&lt;p&gt;Let's create a new file on GitHub Repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--F5uC46F7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0zl7bs87qhxvj9adupik.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F5uC46F7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0zl7bs87qhxvj9adupik.png" alt="GitHub Repository" width="800" height="368"&gt;&lt;/a&gt;&lt;br&gt;
As &lt;strong&gt;users.txt&lt;/strong&gt; file is created on the GitHub Repository but this file is not available on the Local repository.&lt;br&gt;
You can pull your GitHub changes using the command&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Git Fetch
&lt;/h3&gt;

&lt;p&gt;When we use git fetch command, we fetch the commits of a remote repository into our local repository. The fetched commits are saved as remote branches separate from the local branches. So, this helps in reviewing the commits before integrating them into the local working branches.&lt;/p&gt;

&lt;p&gt;Lets create a new file &lt;strong&gt;news.txt&lt;/strong&gt; in the new branch&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mP5Ja7p6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/k9EJeYA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mP5Ja7p6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/k9EJeYA.png" alt="" width="800" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on propose change and this will redirect us to the Pull Request.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wZ47GQux--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/zJht9HD.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wZ47GQux--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.imgur.com/zJht9HD.png" alt="" width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, To work on “newbranch” we need to switch from the main branch to the “newbranch”. The command to switch branch is&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Got an error, notifying newbranch doesn’t match any file doesn’t match any branch or this branch does not exist in the git repository, this does not mean to create a new branch and push it to the GitHub repository because the newbranch is already exiting, you need to fetch this branch before being able to work on it so in order to fetch the branch simply write &lt;code&gt;git fetch origin&lt;/code&gt; and then git checkout newbranch. If you want to fetch just a specific branch you can just specify the below command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git fetch origin [branch-name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After reviewing the changes in the remote branch you can merge it into the local branch using git merge command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout main 
git merge origin/newbranch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you can push the changes to the main branch and it will automatically merge the new branch changes to the main branch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Git clone
&lt;/h2&gt;

&lt;p&gt;git clone is a Git command-line utility that is used to target an existing repository and create a clone, or copy, of the target repository. The command for cloning the repository is.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this lesson, we have learned how to sync the local repository with GitHub and how to use git push, pull, and fetch commands with GitHub. We have also learned how to push changes to GitHub from a local repository.&lt;/p&gt;

&lt;p&gt;If you have any question, please feel free to connect with me on &lt;a href="https://www.linkedin.com/in/adilshehzad7/"&gt;LinkedIn&lt;/a&gt;.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/exploring-github-3hdj"&gt;Exploring GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/all-about-git-github-beginner-to-advance-1061"&gt;Back to Main&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>gitlab</category>
      <category>gitremote</category>
    </item>
    <item>
      <title>Exploring GitHub</title>
      <dc:creator>Adil Shahzad</dc:creator>
      <pubDate>Sat, 19 Mar 2022 05:57:26 +0000</pubDate>
      <link>https://dev.to/adilshehzad786/exploring-github-3hdj</link>
      <guid>https://dev.to/adilshehzad786/exploring-github-3hdj</guid>
      <description>&lt;h2&gt;
  
  
  GitHub repositories
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;GitHub repository&lt;/strong&gt; contains the project's source code and commits history related to the project changes. You can work individually or in a team and provide restricted access to GitHub repositories. The GitHub repositories can be public or private.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to create GitHub repositories
&lt;/h3&gt;

&lt;p&gt;The process to create a GitHub repository is simple. Firstly, we have to sign up for the GitHub Account. As we already learned, how to signup for a GitHub account. &lt;br&gt;
You will need to find a &lt;strong&gt;"+"&lt;/strong&gt; sign at the top right of your GitHub account to get this started. The profile tab is next to it. Click the &lt;strong&gt;"+,"&lt;/strong&gt;, and you will see a dropdown with the first option to create a &lt;strong&gt;"New repository"&lt;/strong&gt;. Once clicked, you will be redirected to another page where you will have to set certain information regarding your project, such as providing a name of your repository, adding a description of the project, declaring if it is public or private.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kXGq65f3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xtq3cskzr08fzbo9xpdq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kXGq65f3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xtq3cskzr08fzbo9xpdq.png" alt="Exploring GitHub" width="800" height="183"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter any repository name and click on &lt;strong&gt;“Create Repository”&lt;/strong&gt;. You can also give a description to your repository (optional).&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JCWJWLkq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5uzkbhmlo5oqc9ghr3vn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JCWJWLkq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5uzkbhmlo5oqc9ghr3vn.png" alt="Exploring GitHub" width="800" height="367"&gt;&lt;/a&gt;&lt;br&gt;
Enter the repository's name and click on &lt;strong&gt;"Create Repository"&lt;/strong&gt;. Describe the repository (optional). Private repositories are only accessible to you, While public repositories are available on the internet and accessible to everyone.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t2nwjZj8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t0neom570rgaj3ziyrw7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t2nwjZj8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t0neom570rgaj3ziyrw7.png" alt="Exploring GitHub" width="800" height="279"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can easily create the first repository; let's explore the repository features.&lt;/p&gt;
&lt;h3&gt;
  
  
  GitHub Issues
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;GitHub issues&lt;/strong&gt; is a tracking feature that integrates to the GitHub repository. You can use issues to be focused on upcoming tasks, fixing bugs, feedback, or tracking ideas related to your project.  &lt;/p&gt;
&lt;h3&gt;
  
  
  What is forking
&lt;/h3&gt;

&lt;p&gt;Forking is a repository copy that allows you to experiment with the changes without affecting the original repository.&lt;/p&gt;

&lt;p&gt;For example, John told Smith to make some changes to the project, so Smith needs to Fork John Repository before making any changes.&lt;/p&gt;
&lt;h3&gt;
  
  
  GitHub Pull Request
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;Pull Request&lt;/strong&gt; is a feature on GitHub which allows informing changes you have made to the repository throughout your branch. &lt;br&gt;
The Repository owner reviews your changes; the reviewer can also request changes if there is any merge conflict or bug; once a pull request is reviewed and approved by the repository owner and can be merged to the main branch.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;keep in mind that all-new repositories created on GitHub will be named "main" instead of "master" as part of the company's effort to remove unnecessary references to slavery and replace them with more inclusive terms&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  GitHub project board
&lt;/h3&gt;

&lt;p&gt;Project boards are integrated into the GitHub repository, which helps organize and prioritize project work. You can create a project board for specific feature work, roadmap, or even a release checklist. Project boards are used for issues and pull requests.&lt;/p&gt;
&lt;h3&gt;
  
  
  GitHub wiki
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;GitHub wiki&lt;/strong&gt; can share detailed information about our project; GitHub wiki can also be used for the project documentation. GitHub wiki can be used with public repositories, and in private repositories, we can use GitHub wiki using GitHub pro, GitHub Team, and GitHub enterprise pricing tier. GitHub wiki uses Markdown Language, a widely useable language for documentation and blogs.&lt;/p&gt;
&lt;h4&gt;
  
  
  What is Markdown language
&lt;/h4&gt;

&lt;p&gt;John Gruber makes markdown, you can use markdown to write blogs, texts, books, and practically 100% of your writing work in a single format, and you can efficiently distribute it in Word, PDFs, EPUBs, HTML, and many other formats.&lt;/p&gt;
&lt;h3&gt;
  
  
  GitHub webhooks
&lt;/h3&gt;

&lt;p&gt;GitHub Webhook provides a notification to the external server like Discord Servers, and they are integrated into the repository can be found in the settings. Whenever an action is performed on the repository or &lt;strong&gt;GitHub organization&lt;/strong&gt;, You can configure your GitHub webhook whenever you execute.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You push changes to the repository &lt;/li&gt;
&lt;li&gt;You Open a Pull request &lt;/li&gt;
&lt;li&gt;Push changes to the &lt;strong&gt;GitHub Pages.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  GitHub organization
&lt;/h2&gt;

&lt;p&gt;GitHub's organizations are shared accounts where business and open-source projects can collaborate across the platform. The GitHub organization provides a manageable access level of members and administrative-level security.&lt;/p&gt;
&lt;h3&gt;
  
  
  How to create a GitHub organization
&lt;/h3&gt;

&lt;p&gt;You will need to find a "+" sign at the top right of your GitHub account to get this started. Your profile tab is right next to it. Click on that, and a dropdown will open with the fourth option to create a "New organization." Select the pricing team accordingly, and then you can easily create your GitHub organization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DAsk20x6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3gchb5kriidepsn83nj1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DAsk20x6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3gchb5kriidepsn83nj1.png" alt="Exploring GitHub" width="800" height="128"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  GitHub pages
&lt;/h2&gt;

&lt;p&gt;GitHub Pages is a static site hosting service that hosts HTML, CSS, JavaScript-based websites. Also, ReactJS and Jekyll (ruby) can be easily hosted using GitHub Pages. GitHub pages run the files through a building process and publish a website, which can be accessed from the username.github.io domain, or you can also use your custom domain. &lt;/p&gt;
&lt;h2&gt;
  
  
  GitHub gist
&lt;/h2&gt;

&lt;p&gt;GitHub gist is the simplest way to share code snippets. All GitHub gists are git repositories, so they are automatically versioned, forkable, and usable from git. It is used to share or embed a sample code or technique with your team. &lt;/p&gt;
&lt;h3&gt;
  
  
  How to create GitHub Gist
&lt;/h3&gt;

&lt;p&gt;You will need to find a "+" sign at the top right of your GitHub account to get this started. Your profile tab is right next to it. Click on that, and a dropdown will open with the third option to create "New gist."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YDDmHEhJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r7cabyhyc1pms3uaxld2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YDDmHEhJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r7cabyhyc1pms3uaxld2.png" alt="New Gist" width="800" height="157"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  GitHub codespaces
&lt;/h2&gt;

&lt;p&gt;GitHub Codespaces is a cloud-hosted VSCode based editor which can be accessed from a Web Browser that includes the editor, terminal, debugger, settings sync, and any extension, so you can easily collaborate on the project.&lt;/p&gt;
&lt;h2&gt;
  
  
  GitHub Rest API
&lt;/h2&gt;
&lt;h3&gt;
  
  
  What is API?
&lt;/h3&gt;

&lt;p&gt;API Stands for Application Program interface, which developers use to access information on the cloud. It allows the different cross-platforms to communicate with each other—for example, Google Assistant.&lt;/p&gt;
&lt;h3&gt;
  
  
  What is GitHub Rest API?
&lt;/h3&gt;

&lt;p&gt;GitHub RestApi or (GitHub API) can interact with GitHub. With the help of GitHub API, we can create and manage repositories, pull requests, issues, and more. You can access the public repositories and information using GitHub API. However, if you need to access, create or manage resources on GitHub, you need to provide your GitHub access token.&lt;/p&gt;
&lt;h3&gt;
  
  
  How to use GitHub Rest API
&lt;/h3&gt;

&lt;p&gt;You can access the public information of the GitHub account by following the command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl https://api.github.com/users/adilshehzad786
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Replace &lt;a class="mentioned-user" href="https://dev.to/adilshehzad786"&gt;@adilshehzad786&lt;/a&gt; with your GitHub username&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VSz02Oms--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tsuqmjngz3ed9txto5hh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VSz02Oms--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tsuqmjngz3ed9txto5hh.png" alt="API" width="800" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub CLI
&lt;/h2&gt;

&lt;p&gt;GitHub CLI helps bring the pull requests, issues, and other GitHub concepts to the terminal.&lt;/p&gt;

&lt;p&gt;You can get more information about the GitHub CLI related to installation and usage on the GitHub CLI Website.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this lesson, we have explored GitHub features and how they could benefit us. We have learned about GitHub repositories and how to create a repository on GitHub. You can Explore GitHub and its services from your GitHub account.&lt;/p&gt;

&lt;p&gt;If you have any question, please feel free to connect with me on &lt;a href="https://www.linkedin.com/in/adilshehzad7/"&gt;LinkedIn&lt;/a&gt;.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/signing-up-for-github-11i0"&gt;Signing Up For GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/all-about-git-github-beginner-to-advance-1061"&gt;Back to Main&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>github</category>
      <category>githubeducation</category>
      <category>git</category>
      <category>githunt</category>
    </item>
    <item>
      <title>Signing Up For GitHub</title>
      <dc:creator>Adil Shahzad</dc:creator>
      <pubDate>Sat, 19 Mar 2022 05:51:51 +0000</pubDate>
      <link>https://dev.to/adilshehzad786/signing-up-for-github-11i0</link>
      <guid>https://dev.to/adilshehzad786/signing-up-for-github-11i0</guid>
      <description>&lt;p&gt;Signing up for a new GitHub account is simple; if you already have a GitHub account, you might be going to the next lesson, which is to explore GitHub Services in more detail. For Students, A GitHub Student Developer might be helpful; you can apply with your university email. For teachers, GitHub also provides a Special Toolkit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup GitHub account
&lt;/h2&gt;

&lt;p&gt;Joining GitHub is very easy. Firstly, go to GitHub SignUp Webpage and enter the unique GitHub username, email address, secure password, verify yourself, and click on create an account. &lt;br&gt;
Check your email; you will receive an email from GitHub for the email verification.&lt;br&gt;
You can skip personalization or provide the required details so that GitHub can personalize some features for you, like a Student Developer Pack or a Special Pack for Teachers.&lt;br&gt;
Right now, click on the continue with free; I will let you know how you can apply for the GitHub student developer pack if you are a current student.&lt;br&gt;
Hurray ✨ Now you are officially on GitHub.&lt;/p&gt;

&lt;p&gt;Let's Discuss &lt;strong&gt;GitHub Pricing&lt;/strong&gt; briefly.&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub pricing
&lt;/h2&gt;

&lt;p&gt;GitHub has three pricing tiers, starting with &lt;strong&gt;free tier&lt;/strong&gt; having unlimited private and public repositories, 2000 minutes/month for automation, which we will use during the course, as a GitHub Action tool and community support. In the &lt;strong&gt;Team pricing tier&lt;/strong&gt;, we have code spaces, 3000 minutes/month for automation, and 2 GB of Packages storage. In the &lt;strong&gt;Enterprise tier&lt;/strong&gt;, we have 50,000 automation minutes/month and 50 GB of Packages storage exclusively used for the prominent organization.&lt;br&gt;
Students can avail GitHub student developer pack, which provides the Team tier to the students to collaborate efficiently. Next, I will explain how students can avail themselves GitHub student developer pack. &lt;/p&gt;

&lt;h2&gt;
  
  
  About GitHub Student Developer Pack
&lt;/h2&gt;

&lt;p&gt;The GitHub Student pack is specially designed to avail themselves of domains, hosting, and learning resources free of cost. With the student developer pack, they can help themselves with the Team tier, through which they can benefit more advantages on the GitHub Platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this lesson, we learn how to create your first GitHub account, about the different pricing tiers of GitHub and how students and teachers benefit from the GitHub programs. I hope you have your GitHub Account, so let us get started to explore more about GitHub in the next lesson.&lt;/p&gt;

&lt;h3&gt;
  
  
  Appendix
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/join"&gt;https://github.com/join&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://education.github.com/pack"&gt;https://education.github.com/pack&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://education.github.com/toolbox"&gt;https://education.github.com/toolbox&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have any question, please feel free to connect with me on &lt;a href="https://www.linkedin.com/in/adilshehzad7/"&gt;LinkedIn&lt;/a&gt;.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/understanding-git-remote-jjh"&gt;Understanding Git Remote&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/all-about-git-github-beginner-to-advance-1061"&gt;Back to Main&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>githubeducation</category>
      <category>githubfree</category>
    </item>
    <item>
      <title>Understanding Git Remote</title>
      <dc:creator>Adil Shahzad</dc:creator>
      <pubDate>Sat, 19 Mar 2022 05:46:36 +0000</pubDate>
      <link>https://dev.to/adilshehzad786/understanding-git-remote-jjh</link>
      <guid>https://dev.to/adilshehzad786/understanding-git-remote-jjh</guid>
      <description>&lt;h2&gt;
  
  
  Git remote
&lt;/h2&gt;

&lt;p&gt;Previously, we have learned about the advanced concepts of Git, and we are familiar with most of the ideas, such as the branches, merging which are very important when it comes to &lt;strong&gt;Advance GitHub&lt;/strong&gt;. You will now be introduced to typical teamwork workflow and using remote repositories correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are remote repositories
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;&lt;em&gt;remote repository&lt;/em&gt;&lt;/strong&gt; is a git repository hosted on the internet or another network.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why work on remote?
&lt;/h2&gt;

&lt;p&gt;From the start, we have been working on the local repository. Git is a distributed version control system, which means that the repositories are not stored in a single server. However, each client has its local repository with its commits and history in many repositories. These commits can be easily shared, and files can also be edited. This is how Git can easily manage teamwork locally. As teamwork is more based on the commit history, we can quickly get an idea about the project’s modifications through commits logs. So, where does Git remote play its role? For example, one of the developers from the team needed to access the commits. However, the person who has committed in the local repository is not available, so how the developer can access the project commits, through which the developer works, might slow down. This is where git remote helps us; through remote repositories, we can easily host our code on the remote server. Everyone who has access to the team’s repository can quickly push or pull commits through the remote server. Even if you are working individually on a project, adding the remote repository to your local repository will learn how to add it to your local repository. The way you have a backup of your project history and the help of the remote repository, you can access and modify your project anywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Git remote platforms
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt;, &lt;strong&gt;GitLab&lt;/strong&gt;, and &lt;strong&gt;Bitbucket&lt;/strong&gt; are the most popular service code hosting services on the internet. They all have different pricing tiers and features; we will explore GitHub in this course, so let us get started with GitHub.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt; is a web-based git or version control repository and internet hosting service. From Open source to business, you can easily host code, manage projects, and build software alongside 50 millions developers around the globe. GitHub also offers distributed version control and source code management (SCM) functionality of Git and its features like GitHub Actions.&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub and Open source
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt; is a platform for the largest Open Source community in the world. With GitHub, you can contribute to the projects you have expertise in. For example, I have expertise in python, so I will find python based projects on GitHub to contribute by fixing bugs or adding new features to the project. A GitHub workflow for open source contributions needs to be followed; we will discuss it more in the GitHub workflow lesson. For GitHub workflow, you need to follow some setups. Firstly, we need to clone it to contribute to a project, so this process is called forking. You can make your code changes on the copy project, and when you are done with your changes, submit a pull request to the maintainer of the code. The maintainer will review the code, and when the maintainer is satisfied with the changes, the maintainer will merge the changes to the default branch. Open source projects are limited to the code; they need docs, translators, community managers, maintainers, and so much more. We will discuss GitHub more and its feature in the next lesson. Let us get started on GitHub by creating a GitHub account.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Working on local repositories is fun, but sometimes you need to work remotely on a project with teammates; whenever you need to host your project online on the remote repositories. We also discuss GitHub and Open source. In upcoming lessons, we will explore more about GitHub features. If you do not have an account on GitHub, let us create a GitHub account, and if you are a student or an academic teacher, then a special surprise for you in the next lesson.&lt;/p&gt;

&lt;p&gt;If you have any question, please feel free to connect with me on &lt;a href="https://www.linkedin.com/in/adilshehzad7/"&gt;LinkedIn&lt;/a&gt;.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/understanding-advance-git-1lh2"&gt;Understanding Advance Git&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/all-about-git-github-beginner-to-advance-1061"&gt;Back to Main&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>gitremote</category>
    </item>
    <item>
      <title>Understanding Advance Git</title>
      <dc:creator>Adil Shahzad</dc:creator>
      <pubDate>Sat, 19 Mar 2022 05:42:20 +0000</pubDate>
      <link>https://dev.to/adilshehzad786/understanding-advance-git-1lh2</link>
      <guid>https://dev.to/adilshehzad786/understanding-advance-git-1lh2</guid>
      <description>&lt;h2&gt;
  
  
  Branches
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Git branching&lt;/strong&gt; allows developers to diverge from the production version of code to fix a bug or add a feature.&lt;br&gt;
Here is an &lt;strong&gt;example&lt;/strong&gt; of how git branches are helpful. Let's say you need to work on a new website feature, create a branch and checkout to the new branch, and start working. Once you complete new features, you can merge your changes to the &lt;strong&gt;master branch&lt;/strong&gt;. &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%2F2x7qrgsfcowmj5c55oor.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%2F2x7qrgsfcowmj5c55oor.PNG" alt="Branch"&gt;&lt;/a&gt;&lt;br&gt;
As shown in the image above, we have a default branch, the &lt;strong&gt;master branch&lt;/strong&gt;. To add new features to the project, we can easily create a new branch and start working; someone else from the team member can also contribute to the Repository by creating a &lt;strong&gt;new branch&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to create a branch
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Option 1: Creating a branch &amp;amp; Checkout
&lt;/h3&gt;

&lt;p&gt;You can create your new branch with the following command.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Replace &lt;strong&gt;&lt;/strong&gt; with whatever name you want.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and with the following command, you can list the branches&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The current local branch will be marked with an &lt;strong&gt;asterisk (*)&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If the asterisk is not visible on your new branch, it means you are not on the new branch. With the following command, you can easily check out the new branch.&lt;br&gt;
&lt;/p&gt;

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

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

&lt;/div&gt;



&lt;p&gt;Now, you can use the &lt;code&gt;git branch&lt;/code&gt; to check which branch you are currently using. The current branch will be marked with an asterisk(*).&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 2: Creating a branch using checkout
&lt;/h3&gt;

&lt;p&gt;Through this command, you can easily create a new branch and checkout to the branch simultaneously.&lt;br&gt;
&lt;/p&gt;

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

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

&lt;/div&gt;



&lt;p&gt;And with the &lt;code&gt;git branch&lt;/code&gt; you can check on which branch you are currently. The current branch will be marked with an asterisk(*).&lt;/p&gt;

&lt;h3&gt;
  
  
  delete a branch
&lt;/h3&gt;

&lt;p&gt;To &lt;strong&gt;delete the local branch&lt;/strong&gt;, use the following command.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-d&lt;/code&gt; option only deletes the branch if it has already been merged. The &lt;code&gt;-D&lt;/code&gt; option is a shortcut for --delete --force, which deletes the branch irrespective of its merged status.&lt;br&gt;
&lt;/p&gt;

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

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  merging
&lt;/h2&gt;

&lt;p&gt;Once you complete your work with the branches, you need to use the Merge method. Merging takes your branch changes and merges them to the main branch, the master branch, by default. Depending on the commit history, git performs two ways of merging. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fast-forward or two-way merging&lt;/li&gt;
&lt;li&gt;Three-way merging&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Fast-forward
&lt;/h3&gt;

&lt;p&gt;In the &lt;strong&gt;Fast Forward method&lt;/strong&gt;, where merging includes only snapshots, let me clear more with an example. Let's say you have completed your work on the feature branch (which is your new branch), and you merge the changes with the master branch, which is the default branch in git. Assume that the master branch has no more commits from the time you created a new branch.&lt;br&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%2Fj7nu9ae20n7fkjes1y7h.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%2Fj7nu9ae20n7fkjes1y7h.png" alt="Fast Forward Method"&gt;&lt;/a&gt;&lt;br&gt;
When the feature branch has to be merged with the master branch, the two of the most recent commits on either of these branches, C3 and F2, compare and merge automatically, unless no merge conflict error occurred—called &lt;strong&gt;fast forward or two-way merge&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Three-way merge (or recursive)
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;Three-Way process&lt;/strong&gt; involves three snapshots, two of the snapshots are involved in the two-way process (Fast-Forwarding) as already discussed. The third one is the base file or the Parent, with which two files are compared.&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%2F3sd3qfi8rqcoa36z8zbk.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%2F3sd3qfi8rqcoa36z8zbk.png" alt="Three Way Method"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you see, C3 is the Parent with which C4 and F2 files are compared for merging.&lt;/p&gt;
&lt;h3&gt;
  
  
  How merging works
&lt;/h3&gt;

&lt;p&gt;As we have already discussed Merge in detail, let's do some practical hands-on. We have also learned how to create a new branch, the file created inside the new branch will not be accessible to the master branch, which is our default branch in Git, until we merge the &lt;strong&gt;new branch&lt;/strong&gt; with the &lt;strong&gt;master branch&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Merging branches in a local repository
&lt;/h3&gt;

&lt;p&gt;Use &lt;code&gt;git checkout&lt;/code&gt; to switch the branch you want to merge into to merge locally. The branch we usually switch first is typically the master branch, which is the default branch. Next, use the &lt;code&gt;git merge&lt;/code&gt; and specify the branch name to merge the new branch with the master branch. This method is also called Fast Forward Merge. &lt;/p&gt;

&lt;p&gt;Create a new branch using the command &lt;code&gt;git branch new branch&lt;/code&gt; you can change the &lt;code&gt;new branch&lt;/code&gt; name specifically to your project feature, for example, &lt;code&gt;dev branch&lt;/code&gt; and you can easily checkout using the &lt;code&gt;git checkout&lt;/code&gt; command when you create a new file in the new branch you need to follow the &lt;code&gt;staging and committing&lt;/code&gt; procedure. Once the process is completed, you can follow the commands given below;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
git checkout master

git merge &amp;lt;newbranch&amp;gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Aborting merge
&lt;/h3&gt;

&lt;p&gt;You can also abort the merging process in case of merge conflict issues with the following command.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Merge only one specific commit
&lt;/h2&gt;

&lt;p&gt;Sometimes we need to merge a specific commit; use cherry-pick. Let's discuss what cherry-pick is.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cherry-pick
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cherry-pick&lt;/strong&gt; allows you to choose the specific existing commit to include in another branch, and with the help of cherry-picking, you can merge a particular commit of exiting. &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%2F0e3hzw0svehplkfzkhf3.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%2F0e3hzw0svehplkfzkhf3.png" alt="Cherry-Pick"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a new branch, checkout to the new branch, add the files, stage, and then commit your changes in the new branch. Use the following command to get the specific commit ID.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log --pretty=format:"%h %s" 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can easily merge the specific commit ID to the default branch master using commit ID. Once copied, the commit ID is then checked out to the master branch and used the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout master
git cherry-pick 12670fd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Merge Conflict
&lt;/h2&gt;

&lt;p&gt;Merge conflicts may occur if completing changes are made to the same line of a file, or if the file that someone else is attempting to edit is deleted. We will discuss further how to resolve to merge conflict issues using Github.&lt;/p&gt;

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

&lt;p&gt;If you are collaboratively working on a project with other developers, then you would notice very quick changes on the repository, and it would not be the same repository you have started to work with, as new features and changes would be added. This is where rebasing comes into action. Rebasing takes commits and stores them in a temporary location. It takes the latest version and adds the commit on top of the latest version. So in this way rebasing ensures that your commits are added to the current state of the project, and not to the old state of the project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rebase Vs Merge
&lt;/h3&gt;

&lt;p&gt;Rebasing and rebasing both are designed to integrate change from one branch to another branch but in different ways. &lt;/p&gt;

&lt;p&gt;Let's say we are working on a project with a repository having committed. Merge will result as combinations of commits, whereas rebase will add changes in the feature branch starting from the last commit of the master branch.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;When you rebase a feature branch onto the master, you move the base of the feature branch to the master branch's ending point.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Merging takes the content of the feature branch and integrates it with the master branch. As the result, only the master branch is changed. The feature branch remains the same.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Merging adds a new commit to your repository history.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  How Rebase Works
&lt;/h3&gt;

&lt;p&gt;To Rebase the feature branch onto the master branch, use the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout feature
git rebase master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Squash
&lt;/h2&gt;

&lt;p&gt;Git squash is a technique that helps you to take a series of commits and consider it to a few commits. for example, Assume that you have a series of commits with the help of git squash we can me all the n number of commits to a single commit. &lt;/p&gt;

&lt;p&gt;Squashing is mainly used to describe a large number of commits, to make it to a small number of meaningful commits so that you can make the git history clean. &lt;/p&gt;

&lt;p&gt;Git squash is also used for the merging of branches. Most developers also advise you to always squash the commits and rebase them with the parent branch(master).&lt;/p&gt;

&lt;p&gt;So when you are squashing and rebasing with the parent branch, the history of the master branch will be way clean, and you will have meaningful commits.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to do git squash
&lt;/h3&gt;

&lt;p&gt;First, we will use the following command to print the logs in one line.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Let's squash the last three commits. These commits explain that we have added a new file. We can use the following command to squash the last three commits.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git rebase -i HEAD~3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Interactive -i command will open up the editor which will have the three commits. Just add the &lt;strong&gt;&lt;code&gt;s&lt;/code&gt;&lt;/strong&gt; word to the last commit as shown in the image below and save the file. &lt;br&gt;
&lt;a href="/api/collection/6072545423392768/5823936264142848/page/5201103670476800/image/6098933834579968?page_type=collection_lesson" class="article-body-image-wrapper"&gt;&lt;img src="/api/collection/6072545423392768/5823936264142848/page/5201103670476800/image/6098933834579968?page_type=collection_lesson"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In Vim you can Insert by pressing the key &lt;strong&gt;i&lt;/strong&gt;. The command to save a file in Vim and quit the editor is:wq. To save the file and exit the editor simultaneously, press Esc to switch to normal mode, type:wq, and hit Enter.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After writing and quitting your file using vim, the editor will open another editor having the commits, you can change the commits, as shown in the image below. And when you are done with your changes, git squash will merge the commits to one. &lt;/p&gt;

&lt;p&gt;You can check whether the last three commits are merged by the git squash using the command below:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Git stash
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;According to the Atlassian&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Git Stash command takes your uncommitted changes(both staged and unstaged changes), saves them for later on, and then revert them from your working copy.  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It is a way to store any uncommitted changes and revert your file to the last commit. Then you can do any other git command during this time. When ready, you can reapply your stored changes into your working directory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why should we use git stash
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Imagine the scenario,&lt;/strong&gt; you are working on a new feature branch for a project. A Developer asks for some help and wants you to check something in another branch. However, the changes you made in the new feature branch are not entirely committed. Here, git stash comes in handy; instead of making half-completed commits, you can temporarily save your uncommitted changes using git stash. Then you can safely check out to another branch. When you are finished helping the developer, you can return to your branch and continue exactly where you left.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to use git stash
&lt;/h3&gt;

&lt;p&gt;These are the two basic commands which we will use.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use this command to stash your current work.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

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

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Use this command to reapply your stashed work back to your working area, and with this command, you can remove it from the stash.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

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

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  gitignore
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;.gitignore&lt;/code&gt;&lt;/strong&gt; file is a file that specifies the files or folders that we want to ignore.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Let's say we want to ignore a text file; with the help of the &lt;strong&gt;.gitignore file&lt;/strong&gt;, we can easily ignore the text file. Assume that you created a &lt;code&gt;readme.txt&lt;/code&gt; file in my working directory, and you want to ignore the file; write the readme.txt file to the &lt;code&gt;.gitignore&lt;/code&gt; file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And if you want to ignore files using the extensions, write the &lt;code&gt;*.txt&lt;/code&gt; to the &lt;code&gt;.gitignore&lt;/code&gt; file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Let's say you want to ignore a folder. Assume that you are working on a python project and usually use the venv environment in python. You can write the &lt;code&gt;venv/&lt;/code&gt; to the &lt;code&gt;.gitignore&lt;/code&gt; file to overlook this folder.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  How does gitignore work?
&lt;/h3&gt;

&lt;p&gt;From the Git bash terminal, we can easily create the .gitignore file.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;While using Vim to edit the .gitignore file,  you can edit the file from the terminal with this command,&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Press I key to insert text into the .gitignore file&lt;/li&gt;
&lt;li&gt;to quit :wq to successfully write and leave from the vim editor. &lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;With the &lt;code&gt;git status&lt;/code&gt; command, you can check whether the file is ignored or not.&lt;/p&gt;

&lt;h2&gt;
  
  
  releases &amp;amp; version tags
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Tags&lt;/strong&gt; are a simple aspect of git; they allow you to identify specific release versions of code. You can think of a tag as a branch that does not change. Once you create the tag, it loses the ability to change the history of commits. &lt;/p&gt;

&lt;p&gt;There are two types of git tags. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Annotated tags&lt;/li&gt;
&lt;li&gt;Lightweight tags&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Annotated tags
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Annotated tags&lt;/strong&gt; store metadata such as author name, release notes, tag message, and data stored as an object in the git database. All this data is important for the public release of the project. &lt;/p&gt;

&lt;p&gt;To create a tag using the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git tag -a v1.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In case if you want to add a tag message, then use the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git tag -a v1.0.0 -m " Release version v1.0.0"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Lightweight tags
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Lightweight tags&lt;/strong&gt; are the simplest way to add a tag to your git repository because they store only the hash of commit as lightweight tags do not contain extra information. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Lightweight tags&lt;/strong&gt; are essentially bookmarks to a commit; they are just a name and pointer to commit. &lt;strong&gt;- Bitbucket&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To create lightweight tags, you can use the following command.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  What have we learned so far?
&lt;/h2&gt;

&lt;p&gt;We learned different advanced concepts of Git, containing branches, merging, cherry-pick, and tags. As these concepts are a bit hard for beginners, but if you focus more on the hands-on git commands, you can easily get the concepts of the git advance features, as we discuss every topic in detail, this is a brief overview of some git advance commands.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;To list &lt;strong&gt;branches&lt;/strong&gt;, we use the command &lt;strong&gt;&lt;code&gt;git branch&lt;/code&gt;&lt;/strong&gt; and to create the branch, we use &lt;strong&gt;&lt;code&gt;git branch new branch&lt;/code&gt;&lt;/strong&gt; and then switch to the new branch we use the command &lt;strong&gt;&lt;code&gt;git checkout new branch&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To &lt;strong&gt;merge&lt;/strong&gt; the new branch with the default branch, first, we need to switch back to the default branch with the following command &lt;strong&gt;&lt;code&gt;git checkout master&lt;/code&gt;&lt;/strong&gt; and then we can merge the new branch to the default branch with the following command &lt;strong&gt;&lt;code&gt;git merge new branch&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To merge a specific commit, we learn about the &lt;strong&gt;cherrypick&lt;/strong&gt;, with the following command, we can merge a specific commit &lt;strong&gt;&lt;code&gt;git cherrypick &amp;lt;commit-ID&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Please feel free to use the terminal for the git commands so that you can learn and have hands-on experience with the git advance commands. Please follow up as I already added the working on every git command.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;This lesson mainly dealt with the advanced git concepts; as we covered branches and why we use branches, we learned advanced concepts of Git. In the next lesson, we will learn about the Git remote repositories, why we use git remote repositories, and How to learn about a handy tool: &lt;strong&gt;GitHub.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you have any question, please feel free to connect with me on &lt;a href="https://www.linkedin.com/in/adilshehzad7/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/understanding-git-2gg"&gt;Understanding Git&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/all-about-git-github-beginner-to-advance-1061"&gt;Back to Main&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>All About Git &amp; GitHub—Beginner to Advance ️</title>
      <dc:creator>Adil Shahzad</dc:creator>
      <pubDate>Fri, 18 Mar 2022 19:41:01 +0000</pubDate>
      <link>https://dev.to/adilshehzad786/all-about-git-github-beginner-to-advance-1061</link>
      <guid>https://dev.to/adilshehzad786/all-about-git-github-beginner-to-advance-1061</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/adilshehzad786/understanding-version-control-system-3o1i"&gt;Understanding Version Control System&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/adilshehzad786/understanding-git-2gg"&gt;Understanding Git&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/adilshehzad786/understanding-advance-git-1lh2"&gt;Understanding Advance Git&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/adilshehzad786/understanding-git-remote-jjh"&gt;Understanding Git Remote&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/adilshehzad786/signing-up-for-github-11i0"&gt;Signing Up For GitHub&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/adilshehzad786/exploring-github-3hdj"&gt;Exploring GitHub&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/adilshehzad786/introducing-git-github-ida"&gt;Introducing Git &amp;amp; GitHub&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/adilshehzad786/understanding-github-workflow-348i"&gt;Understanding GitHub WorkFlow&lt;/a&gt;  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/adilshehzad786/git-cheat-sheet-for-beginners-46b4"&gt;Git Cheat sheet for Beginners&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Please follow to get more blogs on such technical topics&lt;/em&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  Connect with Me 👋
&lt;/h2&gt;

&lt;p&gt;Let me know if you have any question or suggestion. You can connect with me on &lt;a href="https://www.linkedin.com/in/adilshehzad7/"&gt;LinkedIn&lt;/a&gt;, Also Feel free to get a &lt;a href="https://linktr.ee/adilshehzad786"&gt;Mentorship&lt;/a&gt; Session if you have any query related to DevOps.&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>githubeducation</category>
      <category>githunt</category>
    </item>
    <item>
      <title>Understanding Git</title>
      <dc:creator>Adil Shahzad</dc:creator>
      <pubDate>Fri, 18 Mar 2022 19:39:09 +0000</pubDate>
      <link>https://dev.to/adilshehzad786/understanding-git-2gg</link>
      <guid>https://dev.to/adilshehzad786/understanding-git-2gg</guid>
      <description>&lt;h2&gt;
  
  
  Git overview
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Git&lt;/strong&gt; is a &lt;em&gt;Free and Open-Source Distributed Version Control System&lt;/em&gt;. Git’s purpose is to keep track of projects and files as they change over time from different users. &lt;br&gt;
A &lt;strong&gt;repository&lt;/strong&gt; is committed to the project, and the &lt;strong&gt;HEAD&lt;/strong&gt; refers to the current commit viewing in the repository.&lt;/p&gt;

&lt;p&gt;All this information related to the project is stored in the &lt;strong&gt;.git/&lt;/strong&gt; folder, usually known as a git repository, which is mainly hidden by default in the project directory. So basically, Git keeps track of changes made by the developers on the project they are working on. Also, developers can work on the different branches, which helps them add more features to the project to resolve bugs, and when they are done with the changes, they can merge the changes to the default branch, which is the main branch. These techniques help the developers to track down bugs or software failures with the help of commits made to the project.&lt;/p&gt;
&lt;h3&gt;
  
  
  What is HEAD?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;HEΑD&lt;/strong&gt; is a pointer, which αlwαys points to the latest commit in the branch. Whenever a user commits to the project repository, HEAD is updated with the latest commit. The heads of the branches are stored in the &lt;strong&gt;.git/refs/heads/&lt;/strong&gt; directory.&lt;/p&gt;
&lt;h3&gt;
  
  
  What is a git repository?
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;Git repository&lt;/strong&gt; is a &lt;strong&gt;.git/&lt;/strong&gt; directory inside a project which tracks and saves all the history and changes made to the files or folders in a git repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;If you delete the .git/ folder, you delete your project history.&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Git uses a Distributed Version Control System to track all changes made to the project and save them into the repository. Users can then delete or copy the existing repository or create a new one for the current projects.&lt;/p&gt;
&lt;h3&gt;
  
  
  Types of git repository
&lt;/h3&gt;
&lt;h4&gt;
  
  
  Bare repository
&lt;/h4&gt;

&lt;p&gt;The software Development team uses &lt;strong&gt;Bare Repositories&lt;/strong&gt; to share changes. Individual users cannot modify or create new versions of the repository. &lt;/p&gt;
&lt;h4&gt;
  
  
  non-Bare repository
&lt;/h4&gt;

&lt;p&gt;In &lt;strong&gt;non-Bare repositories&lt;/strong&gt;, users can easily modify the existing repository and create a new version. By default, the cloning process creates a non-bare repository.&lt;/p&gt;
&lt;h2&gt;
  
  
  Git workflow
&lt;/h2&gt;

&lt;p&gt;These are the Git stages (workflow)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;modified &lt;/li&gt;
&lt;li&gt;staged&lt;/li&gt;
&lt;li&gt;committed&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  modified
&lt;/h3&gt;

&lt;p&gt;Whenever users make changes to the files, git cannot track those changes. We must move the file to the staged area using the &lt;strong&gt;&lt;code&gt;git add&lt;/code&gt;&lt;/strong&gt; command to track the changes.&lt;/p&gt;
&lt;h3&gt;
  
  
  staged
&lt;/h3&gt;

&lt;p&gt;On the other hand, in the stage, files modifications are tracked by git, part of the snapshot.&lt;/p&gt;
&lt;h3&gt;
  
  
  committed
&lt;/h3&gt;

&lt;p&gt;The changes made into the file successfully become a part of the latest snapshot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--okdOh-dA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cj34fsrszhvyzsojhtmt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--okdOh-dA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cj34fsrszhvyzsojhtmt.png" alt="Git Workflow" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, when we add the file to the working directory, the file is usually untracked, and to track the file, we need to stage the file; for this, we use the &lt;code&gt;git add&lt;/code&gt; command, and when the file followed, we need to commit on the file with the following command &lt;code&gt;git commit&lt;/code&gt;. When we edit the file, the file will be again in the untracked stage, and we need to stage and commit to the file. We can also reset the staged area to untracked the file that we tracked accidentally. Let us get started with git by installing it first.&lt;/p&gt;
&lt;h2&gt;
  
  
  Git installation
&lt;/h2&gt;

&lt;p&gt;To get started with Git, &lt;a href="https://git-scm.com/downloads"&gt;Download the Git&lt;/a&gt; concerning your operating system. Once installation is complete, you can check the git version with the following command after installation is completed.&lt;br&gt;
&lt;/p&gt;

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

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Git configuration
&lt;/h2&gt;

&lt;p&gt;The purpose of the git configuration is to configure user information used across all local repositories. The username and email are associated whenever the user commits changes to the repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.name "[firstname lastname]"

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

&lt;/div&gt;



&lt;p&gt;After the name configuration on git CLI, configure the email with the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.email "youremail@yourdomain.com"

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

&lt;/div&gt;



&lt;p&gt;Once done, you can confirm that the information is set by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --list

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Using git for a new project
&lt;/h2&gt;

&lt;p&gt;Let’s see how we can set up a new project using Git.&lt;/p&gt;

&lt;h3&gt;
  
  
  Initializing the repository
&lt;/h3&gt;

&lt;p&gt;First, we need to create a new directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
mkdir &amp;lt;git_basic&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;Now, we need to navigate to the directory which we created earlier.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
cd &amp;lt;git_basic&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the following command to initialize an empty git repository inside the working directory.&lt;br&gt;
&lt;/p&gt;

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

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

&lt;/div&gt;



&lt;p&gt;After this command, a &lt;strong&gt;.git/&lt;/strong&gt; folder will be initialized to the working directory; you can use the following command to list the hidden files and folders.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls -A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Git status
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Git status&lt;/strong&gt; is used to show the level of file changes as untracked, modified, or staged. &lt;br&gt;
Let us create the first file that we will be tracking using git. Make Sure still in the &lt;strong&gt;git_basic&lt;/strong&gt; directory terminal. To create new files in the current directory from the terminal, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
touch README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;.md&lt;/strong&gt; extension is used for the Markdown Language. Markdown is a lightweight markup language with plain-text-formatting syntax.&lt;/p&gt;

&lt;p&gt;Use the following command to open the file in the vim editor.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
vim README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once in the Vim editor, press &lt;strong&gt;I&lt;/strong&gt; from the keyboard to start editing. When done with editing, press the &lt;strong&gt;ESC&lt;/strong&gt; button. The command to save a file in Vim and quit the editor is &lt;strong&gt;:wq&lt;/strong&gt;. As soon as the file is saved, the state of the repository will be changed. The status of the file can be easily tracked by running the following command:&lt;br&gt;
&lt;/p&gt;

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

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

&lt;/div&gt;



&lt;p&gt;The git status command does not change or update anything. Instead, it prints out which files are modified, staged, or untracked. To stage the file, we need to learn about staging and committing.&lt;/p&gt;

&lt;h2&gt;
  
  
  staging and committing
&lt;/h2&gt;

&lt;h3&gt;
  
  
  staging
&lt;/h3&gt;

&lt;p&gt;Before committing, we must tell git what files we want to  &lt;strong&gt;(untracked, modified, or deleted)&lt;/strong&gt; to the project directory. To track the git working directory files, we use the &lt;code&gt;git add&lt;/code&gt; command. Why do we need to do this? Why can't we commit directly? Let us work on two files simultaneously but want to commit only one completed file, so in this situation, the &lt;strong&gt;"git add"&lt;/strong&gt; command helps stage the file. Even deletion of files can also be tracked in the git history, so deleted files must be staged and committed. &lt;/p&gt;

&lt;p&gt;Run the following command on Git Bash to stage the files or folders.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;in the &lt;code&gt;git add .&lt;/code&gt; dot can be used to simultaneously track all the project changes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Alternatively, sometimes only we need to stage one file.&lt;br&gt;
&lt;/p&gt;

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

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

&lt;/div&gt;



&lt;p&gt;The folder can also be staged using the following command.&lt;br&gt;
&lt;/p&gt;

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

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

&lt;/div&gt;



&lt;p&gt;After the add command, you can check the status of the file, whether it's staged or not, using the &lt;strong&gt;&lt;code&gt;git status&lt;/code&gt;&lt;/strong&gt; command. &lt;/p&gt;

&lt;h4&gt;
  
  
  unstaged Files
&lt;/h4&gt;

&lt;p&gt;Sometimes you accidentally staged the files, so with this command, you can unstaged the files from the git staging area.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
git reset [file]

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  commit
&lt;/h3&gt;

&lt;p&gt;Commits work as a snapshot or milestone along the timeline of git progress. Commits are created directly with the &lt;code&gt;git commit&lt;/code&gt; command after the staging of the files. Git snapshots are always committed to the local directory.&lt;/p&gt;

&lt;p&gt;Use the following command to commit changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
git commit -m "Message that describes what this change does."

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;TIP: For commit messages, do not use the past tense, such as "I made a change in the file " use language like "making navbar blue" as you are giving orders to the git.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Fixing your last commit
&lt;/h4&gt;

&lt;p&gt;If you made a mistake in your last commit message, run this command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
git commit --amend -m "Put your correct message here."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  View a List of Commits
&lt;/h4&gt;

&lt;p&gt;You can view the latest and previous commit details using the following command&lt;br&gt;
&lt;/p&gt;

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

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

&lt;/div&gt;



&lt;p&gt;You can also use the following command to see a simplified list of commits.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;To see a list of commits with even more detail (including which files changed), run this command.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: if the commit list is long, you can use the &lt;strong&gt;UP/ Down Arrow key&lt;/strong&gt; and press the &lt;strong&gt;q&lt;/strong&gt; button from the keyboard to exit from the terminal.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What have we learned so far?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To Initialize Git Repository, we use &lt;strong&gt;&lt;code&gt;git init&lt;/code&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;To Stage all the files, we use &lt;strong&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;To Commit the changes, we use &lt;strong&gt;&lt;code&gt;git commit -m "You Message"&lt;/code&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Every time you modify, delete or add the files, you have to use the &lt;code&gt;git add&lt;/code&gt; command and then commit your changes to the git repository using the &lt;code&gt;git commit&lt;/code&gt; command.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;This lesson is essential for the basic understanding of Git. The main takeaways are the three states that a file can be:&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Modified:&lt;/strong&gt; To modify a file on the Working Directory.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Staged:&lt;/strong&gt; To add the file to the Staging Area, so it could be snapshotted.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Committed:&lt;/strong&gt; Snapshot of the entire project (the unmodified and staged files).&lt;/p&gt;

&lt;p&gt;If a file was part of the previous commit and did not modify it, it will automatically be part of the next commit. A modified but unstaged file is considered unmodified. Git will not automatically track the changes, as you have to ask git to follow them by staging those files.&lt;br&gt;
After staging the files, we also learned about committing to the changes.&lt;br&gt;
In the next lesson, we will explore more about advanced concepts of Git such as branches, merge, tags etc.&lt;/p&gt;

&lt;p&gt;If you have any question, please feel free to connect with me on &lt;a href="https://www.linkedin.com/in/adilshehzad7/"&gt;LinkedIn&lt;/a&gt;.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/understanding-version-control-system-3o1i"&gt;Understanding Version Control System&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/all-about-git-github-beginner-to-advance-1061"&gt;Back to Main&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/adilshehzad786/understanding-advance-git-1lh2"&gt;Understanding Advance Git&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>git</category>
      <category>versioncontrolsystem</category>
      <category>distributedsystem</category>
      <category>github</category>
    </item>
    <item>
      <title>Understanding Version Control System</title>
      <dc:creator>Adil Shahzad</dc:creator>
      <pubDate>Fri, 18 Mar 2022 19:31:09 +0000</pubDate>
      <link>https://dev.to/adilshehzad786/understanding-version-control-system-3o1i</link>
      <guid>https://dev.to/adilshehzad786/understanding-version-control-system-3o1i</guid>
      <description>&lt;p&gt;Wrote a code for development, defined variables performed a dry run, and undertook multiple code revisions only to discover that the previously written code was better than the latest one. Reverting to the previous code well is not an easy thing to do. At times, it was a difficult task on the developer's end.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;modification, update, reversion&lt;/strong&gt; formulated &lt;strong&gt;Version Control System&lt;/strong&gt;. Version Control System keeps track of files modification, deletion of files, or folder in a working director.&lt;br&gt;
Let's discuss the version control Systems more in detail.&lt;/p&gt;

&lt;h2&gt;
  
  
  Version Control System
&lt;/h2&gt;

&lt;p&gt;What is &lt;strong&gt;Version Control System?&lt;/strong&gt; Essentially, Version Control Systems allows recording changes to files over time to view specific versions of those files later on.&lt;/p&gt;

&lt;p&gt;Version Control Systems, or VCS, are specialized software. The primary purpose is to manage the codebase changes whenever changes are applied. Also, with the help of a &lt;em&gt;Version Control System&lt;/em&gt;, we can recall a specific version later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do you need one?
&lt;/h2&gt;

&lt;p&gt;Did you work on a project that required recalling the specific changes made to each file? If yes, how did you manage and control each version? Maybe tried to duplicate and rename the files with suffixes like &lt;strong&gt;“review,” “fixed,” or “final”&lt;/strong&gt;, as shown in the below image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--14vpZtGs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tns0euslbixw4yia4ppz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--14vpZtGs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tns0euslbixw4yia4ppz.png" alt="Why we need Git" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All those problems can solve by using a Version Control System or VCS. A Version Control System tracks each change made to every project file and provides a simple way to compare and roll back those changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Version Control system
&lt;/h2&gt;

&lt;p&gt;Version Control Systems have three types, which are following.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Local Version Control System&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;2. Centralized Version Control System&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;3. Distributed Version Control System&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Local Version Control System
&lt;/h3&gt;

&lt;p&gt;In the &lt;strong&gt;Local Version Control System&lt;/strong&gt;, the user manages and controls all the file changes within the local system. All changes are saved in a local database. Revision Control system (RCS) is one of the most common Versions Control System tools. As seen in the image below, each developer has their version control history, and they are only limited to the local databases.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WKBgWpZc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ruhlws0e5fi468fcds1y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WKBgWpZc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ruhlws0e5fi468fcds1y.png" alt="Local Version Control System" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Centralized Version Control System
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;Centralized Version Control System&lt;/strong&gt; contains one repository in which users have stored a working copy of the project they are working on. Users need to commit their changes to the repository to update and reflect its changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_dWzL57c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j9vr4j6ppd5etbiacf5b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_dWzL57c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j9vr4j6ppd5etbiacf5b.png" alt="Centralized Version Control System" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Distributed Version Control System
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;Distributed Version Control System&lt;/strong&gt; contains multiple repositories. All users have their repositories and working copies. Committing the changes will not give other users access to the changes because the commit will only reflect in the local repository. The user needs to push the changes to the central repository. The most popular distributed version control systems are &lt;strong&gt;Git&lt;/strong&gt; and &lt;strong&gt;Mercurial&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IbdtQgrV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bthgl1k5ecc02xpz0xa4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IbdtQgrV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bthgl1k5ecc02xpz0xa4.png" alt="Distributed Version Control System" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of Version Control System
&lt;/h2&gt;

&lt;p&gt;These are the benefits of the version control system.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Using a Version Control System allows collaboration between the team, and users can easily contribute to the codebase simultaneously without overwriting or conflicting with each other works.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Version Control System also enables developers to quickly revert the codebase changes to the last good state in case of any bug or software failure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Distributed Version Control Systems&lt;/strong&gt; like &lt;strong&gt;&lt;em&gt;Git&lt;/em&gt;&lt;/strong&gt; can restore the entire project and the history from any developer's local repository if the central repository is lost or deleted.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why do we use git?
&lt;/h2&gt;

&lt;p&gt;According to the 2021 survey of &lt;strong&gt;StackOverflow&lt;/strong&gt;, 90% of developers use Git, making it the most used distributed version control system in the world. Git is used to tracking changes in a project file.&lt;br&gt;
According to the 2021 survey, 90% of developers use Git, making it the most used distributed version control system in the world. &lt;br&gt;
These are the few reasons developers prefer Git to other distributed version control systems.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Developers can easily track their entire timeline of any project's changes, decisions, and progressions from a single repository. They can access their project history, and the developer has all the context they need to understand it and start contributing to the open-source world.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;With the help of Git, developers can quickly work in every time zone. Team collaboration can efficiently maintain source code integrity. Using branches, developers can safely propose changes to the production environment.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Git&lt;/strong&gt; has many more powerful features covered throughout this course.&lt;br&gt;
We learned about the version control systems and types of different version control systems from this lesson. In the next lesson, we will learn about the basics fundamentals of Git, Installations, Configurations, and basic commands to get started.&lt;/p&gt;

&lt;p&gt;If you have any question, please feel free to connect with me on &lt;a href="https://www.linkedin.com/in/adilshehzad7/"&gt;LinkedIn&lt;/a&gt;.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=""&gt;Understanding Git&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=""&gt;Back to Main&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>git</category>
      <category>vcs</category>
      <category>opensource</category>
      <category>versioncontrolsystem</category>
    </item>
    <item>
      <title>Website deployment Automation with Continuous Integration Using AWS, Jenkins &amp; GitHub</title>
      <dc:creator>Adil Shahzad</dc:creator>
      <pubDate>Wed, 16 Jun 2021 11:56:18 +0000</pubDate>
      <link>https://dev.to/adilshehzad786/website-deployment-automation-with-continuous-integration-using-aws-jenkins-github-2c03</link>
      <guid>https://dev.to/adilshehzad786/website-deployment-automation-with-continuous-integration-using-aws-jenkins-github-2c03</guid>
      <description>&lt;p&gt;DevOps is all about the Agile and speed release of the software and well solutions . one of the best ways is to automate the daily tasks.&lt;/p&gt;

&lt;p&gt;In this blog, we are going to learn how we can automate the website deployment using open-source software called Jenkins with Amazon Web Services and GitHub which is an online version control system platform. Before moving on to the practical work, first, let's learn what is Continuous integration.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;According to &lt;strong&gt;Circle CI,&lt;/strong&gt; Continuous integration (CI) is a software development strategy that increases the speed of development while ensuring the quality of the code that teams deploy. Developers continually commit code in small increments (at least daily, or even several times a day), which is then automatically built and tested before it is merged with the shared repository.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We are also going to use GitHub Webhooks. so whenever we push to the GitHub repo, Webhooks automatically push all the changes to the Jenkins server. The complete architect design of the project is available below which we are going to design.&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%2Fcdn-images-1.medium.com%2Fmax%2F5700%2F1%2A7OUhlsnpmXCZ1mfcDvuj-A.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%2Fcdn-images-1.medium.com%2Fmax%2F5700%2F1%2A7OUhlsnpmXCZ1mfcDvuj-A.png" alt="Jenkins Automation Architech — Adil Shehzad"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Before starting working on Jenkins please make sure you have an &lt;strong&gt;AWS Free tier&lt;/strong&gt; **account **and also an idea of how to use commands on Ubuntu Terminal.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Creating AWS EC2
&lt;/h1&gt;

&lt;p&gt;First, we need to create a Ubuntu Server 20.04 LTS on Amazon Web Services and then we will install the Jenkins server on Ubuntu.&lt;/p&gt;

&lt;p&gt;There are ways to create an AWS EC2 Machine, one is that you can create an AWS EC2 Machine using AWS Dashboard, the second one is that you can create AWS EC2 Using AWS CLI, the third option is that you can create an AWS EC2 using Terraform which is Infrastructure as Code (IaC) process. Please find the following blog resources if you need any help to get started&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://medium.com/faun/why-terraform-how-to-getting-started-with-terraform-using-aws-3269527e921d" rel="noopener noreferrer"&gt;Getting Started with Terraform Using AWS&lt;/a&gt;&lt;br&gt;
 &lt;a href="https://adilshehzad786.medium.com/introduction-to-amazon-elastic-computing-ec2-a-quick-start-guide-b1efd485314a" rel="noopener noreferrer"&gt;Creating AWS EC2 Using AWS Dashboard&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&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%2Fi.imgur.com%2Fx8OVjrf.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%2Fi.imgur.com%2Fx8OVjrf.png" alt="img1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we need to connect with the Instance using Command shell which I found easier . &lt;strong&gt;Keep your key secret! Do not share with anyone!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ssh -i "Jenkins-Server.pem" ubuntu@ec2-3-86-216-74.compute-1.amazonaws.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I am using ssh using command shell and **Jenkins-Server. pem **is the name of my secret key.&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%2Fi.imgur.com%2FtUdTGQK.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%2Fi.imgur.com%2FtUdTGQK.png" alt="img2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Installing JDK on Ubuntu Server
&lt;/h1&gt;

&lt;p&gt;since Jenkins is the java based application so we need to install the &lt;a href="https://en.wikipedia.org/wiki/Java_Development_Kit" rel="noopener noreferrer"&gt;JDK &lt;/a&gt;on the ubuntu server by following commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install default-jdk-headless
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fi.imgur.com%2F23tOK5u.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%2Fi.imgur.com%2F23tOK5u.png" alt="img3"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Install Jenkins
&lt;/h2&gt;

&lt;p&gt;After successfully installing JDK, now we need to install Jenkins.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -

sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ &amp;gt; \
    /etc/apt/sources.list.d/jenkins.list'

sudo apt update

sudo apt-get install jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fi.imgur.com%2FmacOnqA.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%2Fi.imgur.com%2FmacOnqA.png" alt="img4"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's check whether Jenkins is Up and running or not by following the command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo systemctl status jenkins&lt;/code&gt;&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%2Fi.imgur.com%2FZVcTiz7.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%2Fi.imgur.com%2FZVcTiz7.png" alt="img5"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go back to your Ubuntu instances, inside the security scroll down, you will found the inbound rules. Jenkins will update your inbound rules, if your rules did not update you can manually add up your inbound. on your left side find the Security Group. on Security Page, you will found the Edit Inbound Rule and Afterwards, you can add your own rules and save your settings.&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%2Fi.imgur.com%2FkhEva77.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%2Fi.imgur.com%2FkhEva77.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now We need to access Jenkins using a browser&lt;/p&gt;

&lt;p&gt;Go to your AWS EC2 and copy your Public IPv4 address&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;http://3.86.216.74:8080&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Please make sure you are not using HTTPS because it will return a security error. later on, we will install the HTTPS Package on the Jenkins server.&lt;/p&gt;
&lt;/blockquote&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%2Fi.imgur.com%2FZjEVYpt.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%2Fi.imgur.com%2FZjEVYpt.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can retrieve your Jenkins password from your server which you access using the command shell by following the command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo cat /var/lib/jenkins/secrets/initialAdminPassword&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Jenkins Getting Started
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Customize Jenkins
&lt;/h3&gt;

&lt;p&gt;Now, you need to click on the — Install Suggested Plugins&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%2Fi.imgur.com%2F6tKhxVr.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%2Fi.imgur.com%2F6tKhxVr.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating Jenkins Admin Panel
&lt;/h3&gt;

&lt;p&gt;You can create your Admin user or you can skip this by continuing as Admin.&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%2Fcdn-images-1.medium.com%2Fmax%2F3198%2F1%2A10lnveJ6n3RUonr7zpJzOw.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%2Fcdn-images-1.medium.com%2Fmax%2F3198%2F1%2A10lnveJ6n3RUonr7zpJzOw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Jenkins is Ready!
&lt;/h2&gt;

&lt;p&gt;Finally, your Jenkins server is set up on an ubuntu machine now click on the Start using Jenkins.&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%2Fi.imgur.com%2FwHmq77b.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%2Fi.imgur.com%2FwHmq77b.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Jenkins using GitHub WebHooks
&lt;/h2&gt;

&lt;p&gt;In this part, you will learn how to configure a simple Jenkins job/project. This job will be triggered by GitHub Webhooks and will execute a ‘build’ task to retrieve codes from GitHub and store them locally on the Jenkins server.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You can Fork my Repo to get started with Jenkins and GitHub WebHooks because I make it easier for the beginners to get started with Jenkins Journey → &lt;a href="https://github.com/adilshehzad786/Website-deployment-Automation-with-Continuous-Integration-Using-AWS-Jenkins-GitHub" rel="noopener noreferrer"&gt;https://github.com/adilshehzad786/Website-deployment-Automation-with-Continuous-Integration-Using-AWS-Jenkins-GitHub&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go to your Settings → Webhooks and add your Jenkins Server link&lt;/p&gt;&lt;/li&gt;
&lt;/ul&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%2Fcdn-images-1.medium.com%2Fmax%2F3200%2F1%2AOgzvqQ6W0o8akDZ2HDxgVQ.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F3200%2F1%2AOgzvqQ6W0o8akDZ2HDxgVQ.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;http://&amp;lt;YOUR-JENKINS-URL&amp;gt;/github-webhook/&lt;/code&gt;&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%2Fi.imgur.com%2FbeF5q7Z.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%2Fi.imgur.com%2FbeF5q7Z.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, Enter an item name and select the Free-Style project and then click on OK.&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%2Fcdn-images-1.medium.com%2Fmax%2F3198%2F1%2AatW1YiY-kv8VNYSGttlKBQ.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%2Fcdn-images-1.medium.com%2Fmax%2F3198%2F1%2AatW1YiY-kv8VNYSGttlKBQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To connect your GitHub Repository, we need to set the following things&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Checked GitHub Project&lt;/strong&gt; → Paste your GitHub Repository URL&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Source Code Management&lt;/strong&gt; → &lt;strong&gt;Git&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Branches to build&lt;/strong&gt; → &lt;strong&gt;main&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&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%2Fcdn-images-1.medium.com%2Fmax%2F3198%2F1%2Ago1MRfV1hWRvfEK-lpc-hg.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%2Fcdn-images-1.medium.com%2Fmax%2F3198%2F1%2Ago1MRfV1hWRvfEK-lpc-hg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Jenkins Built
&lt;/h2&gt;

&lt;p&gt;Save all the configurations of your project and click on apply. For now, we can only do it manually. Click the “Build Now” button, if you have configured everything correctly, the build will be successful.&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%2Fi.imgur.com%2FwsOvUOu.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%2Fi.imgur.com%2FwsOvUOu.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can open the build and check-in Console Output on your left menu and it will show you that you're built run successfully.&lt;/p&gt;

&lt;p&gt;If so — &lt;strong&gt;Congratulations&lt;/strong&gt;! You have just made your very first Jenkins build!&lt;/p&gt;

&lt;p&gt;But this build does not produce anything and it runs only when we trigger it manually. Let us fix it.&lt;/p&gt;

&lt;p&gt;On your left menu select Configure and then change the following settings&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Built Triggers&lt;/strong&gt; → GitHub hook trigger for GITScm polling&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Post-build Actions&lt;/strong&gt; → Archive the artifacts (Add ** to Files to archive)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now we configure the settings — Apply the settings and save the settings.&lt;/p&gt;

&lt;p&gt;Now, go ahead and make some changes to any file in your GitHub repository (e.g. README.MD file) and push the changes to the main branch. You will see that a new build has been launched automatically (by webhook) and you can see its results — artifacts, saved on the Jenkins server.&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%2Fi.imgur.com%2FgdD1dl3.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%2Fi.imgur.com%2FgdD1dl3.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From now on whenever you push to your Github repository, your building will be updated on your Jenkins server. As I just updated my README.md file from my Github Repo because right now I want to keep this on beginner level so you understand it easily.&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%2Fi.imgur.com%2FHKwPETH.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%2Fi.imgur.com%2FHKwPETH.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Congratulations!&lt;/strong&gt; You have now configured an automated Jenkins job that receives files from GitHub by the webhook trigger. There are also other methods like trigger one job (downstream) from another (upstream), poll GitHub periodically, and others.&lt;/p&gt;

&lt;p&gt;By default, the artifacts are stored on the Jenkins server locally. You can access it by following the command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ls /var/lib/jenkins/jobs/&amp;lt;Project-Name&amp;gt;/builds/&amp;lt;Built # &amp;gt;/archive/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/2612/1*DTOQL8rR8o-xdQr2wdomMA.png" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2612%2F1%2ADTOQL8rR8o-xdQr2wdomMA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Plugin to Jenkins Server
&lt;/h2&gt;

&lt;p&gt;Jenkins is a highly extendable application and has more than 1400+ plugins available. In this blog, we are going to install &lt;strong&gt;“Publish Over SSH”.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to Jenkins Dashboard . on the left side click on the Manage Jenkins&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%2Fmiro.medium.com%2Fmax%2F700%2F1%2Aw9mmqaMMDEKP-3hxhgTxNg.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%2Fmiro.medium.com%2Fmax%2F700%2F1%2Aw9mmqaMMDEKP-3hxhgTxNg.png" alt="img"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and now click on the &lt;strong&gt;Manage Plugin&lt;/strong&gt;&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%2Fcdn-images-1.medium.com%2Fmax%2F3192%2F1%2AGEh4hexAQx94p2nLAjlD9Q.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%2Fcdn-images-1.medium.com%2Fmax%2F3192%2F1%2AGEh4hexAQx94p2nLAjlD9Q.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Search for “Publish over SSH” and then click on Install without Restart&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%2Fcdn-images-1.medium.com%2Fmax%2F3198%2F1%2A73q_e-F_eic1n6-di0q4kQ.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%2Fcdn-images-1.medium.com%2Fmax%2F3198%2F1%2A73q_e-F_eic1n6-di0q4kQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuration of Jenkins Plugin
&lt;/h2&gt;

&lt;p&gt;On the left menu, we have “&lt;strong&gt;manage Jenkins&lt;/strong&gt;” options, click on it, and then go to the &lt;strong&gt;Configure system&lt;/strong&gt;.&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%2Fcdn-images-1.medium.com%2Fmax%2F3192%2F1%2AJWh0qCK_AKHWOfmvmxPnFw.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%2Fcdn-images-1.medium.com%2Fmax%2F3192%2F1%2AJWh0qCK_AKHWOfmvmxPnFw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll down you will found the Publish over SSH&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%2Fcdn-images-1.medium.com%2Fmax%2F2498%2F1%2AbJ4rG8O6q6RcR2DbzfOxDA.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%2Fcdn-images-1.medium.com%2Fmax%2F2498%2F1%2AbJ4rG8O6q6RcR2DbzfOxDA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; **Passphrase: your passphrase**
 2. **path to key:** your private key path
 3. **key **: blank
 4. **Disable exec :** un-check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;SSH Servers&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; 1. **Name:** remote_user@remotehost.com
 2. **hostname**: remotehost.com
 3. **Username:** remote_user
 4. **Remote Directory:** empty
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Advance
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; 5. check the box "use passsword authentication, or use a different  key" `important`

 6. **Passphrase / Password:** your linux login password`important`

 7. **path to key:** blank

 8. **key:**blank

 9. **port:** 22

 10. **Timeout(ms):** 300000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Test the configuration and make sure the connection returns Success. Remember, that TCP port 22 on the NFS server must be open to receive SSH connection&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%2Fcdn-images-1.medium.com%2Fmax%2F3044%2F0%2AkCXjc27_by-kXHlv.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%2Fcdn-images-1.medium.com%2Fmax%2F3044%2F0%2AkCXjc27_by-kXHlv.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save the configuration, open your Jenkins job/project configuration page and add another one “Post-build Action”.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AhYXu5M5Ny6-HRr4f.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F0%2AhYXu5M5Ny6-HRr4f.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Configure it to send all files produced by the build into our previously define remote directory. In our case we want to copy all files and directories — so we use **. If you want to apply some particular pattern to define which files to send — &lt;a href="http://ant.apache.org/manual/dirtasks.html#patterns" rel="noopener noreferrer"&gt;use this syntax&lt;/a&gt;.&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%2Fcdn-images-1.medium.com%2Fmax%2F2836%2F0%2A-JsG-lDWgdoyjdkJ.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%2Fcdn-images-1.medium.com%2Fmax%2F2836%2F0%2A-JsG-lDWgdoyjdkJ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save this configuration and go ahead, change something in README.MD file in your GitHub Tooling repository.&lt;/p&gt;

&lt;p&gt;Webhook will trigger a new job and in the “Console Output” of the job you will find something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SSH: Transferred # of file(s)
    Finished: SUCCESS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;I hope you enjoy reading my Jenkins blog. I have other articles like how to create AWS services using terraform, and also how to create an AWS ec2 easily. Feel free to connect with me on Linkedin and also on the following platform by clicking the below link. this is the end, see you in another blog. Feel Free to Reach Me out on Linkedin &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/adilshehzad7/" rel="noopener noreferrer"&gt;Linkedin &lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>github</category>
      <category>git</category>
      <category>jenkins</category>
    </item>
  </channel>
</rss>
