<?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: Rahul Sinha</title>
    <description>The latest articles on DEV Community by Rahul Sinha (@rahulsinha036).</description>
    <link>https://dev.to/rahulsinha036</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%2F390543%2F5091d7e6-6da2-46cb-b47a-533ec0bbd47a.jpeg</url>
      <title>DEV Community: Rahul Sinha</title>
      <link>https://dev.to/rahulsinha036</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rahulsinha036"/>
    <language>en</language>
    <item>
      <title>Generate Certificate Using Python</title>
      <dc:creator>Rahul Sinha</dc:creator>
      <pubDate>Thu, 21 May 2020 07:18:59 +0000</pubDate>
      <link>https://dev.to/rahulsinha036/generate-certificate-using-python-43fa</link>
      <guid>https://dev.to/rahulsinha036/generate-certificate-using-python-43fa</guid>
      <description>&lt;p&gt;Most have you thought that I could generate a certificate automatically for the attendees. This was my problem also because being a Microsoft Student Partner I tool many virtual events. So creating certificates are the most headache things I ever saw. &lt;br&gt;
Then I got the idea to develop a program that generates certificates automatically. I go with python because it is very dynamic in use and when we create very long codes in a short format in python. &lt;/p&gt;
&lt;h2&gt;
  
  
  Let's Start writing our Code!
&lt;/h2&gt;

&lt;p&gt;The first things are we have to &lt;strong&gt;import pandas.&lt;/strong&gt; Because we will be dealing with the excel sheets where are the names of the attendees are there. Like I have a created a demo excel sheet.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e5Gmu9q2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/72myrjmnb77t4ebllvco.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e5Gmu9q2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/72myrjmnb77t4ebllvco.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's import &lt;em&gt;pandas&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;After importing pandas, we have to import &lt;strong&gt;pillow&lt;/strong&gt; package for using &lt;em&gt;Image&lt;/em&gt; and &lt;em&gt;Font&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from PIL import Image, ImageDraw, ImageFont
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now, we have read our excel file. We will use the panda read_excel function here to read the data.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data = pd.read_excel(r,'C:\Users\Rahul sinha\names.xlsx')
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Note - place "r" before the path string to address special character, such as '\'. Place your whole where your file is saved.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now create a &lt;strong&gt;name_list&lt;/strong&gt; variable where all the names of the attendees will be saved.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name_list = data["Name"].tolist() 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Here, you see &lt;em&gt;"Name"&lt;/em&gt;, it is the name of the column under which all the attendee names are there. Basically we are indexing all the names. Then converting all the names to the list.&lt;/p&gt;

&lt;p&gt;Now we have to use a loop to print all the certificates of the attendees present in the excel sheet. &lt;br&gt;
I am sharing the whole code.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for i in name_list:
    im = Image.open(r'C:\Users\Rahul sinha\certificate_img.jpg')
    d = ImageDraw.Draw(im)
    location = (100, 398)
    text_color = (0, 137, 209)
    font = ImageFont.truetype("arial.ttf", 120)
    d.text(location, i, fill = text_color, font = font)
    im.save("certificate_" + i + ".pdf")
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I am explaning the whole code one by one. First I open the certificate image using &lt;em&gt;Image.open&lt;/em&gt;. Here is the screenshot of the demo certificate.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8XXQA8Qu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/o6pwe44qigddsgzzxd4g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8XXQA8Qu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/o6pwe44qigddsgzzxd4g.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One thing I want to clear that &lt;em&gt;for i in name_list&lt;/em&gt; &lt;em&gt;i&lt;/em&gt; is all the names of the attendees. &lt;br&gt;
For the location, we can use paint to point where our names should be printed. Open Paint. Go to &lt;em&gt;view section&lt;/em&gt; and tick the &lt;em&gt;status bar&lt;/em&gt;. It shows the position of the mouse on the image on the down side.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Jr4STl2s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/homjkmw6llp7gwbotluy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Jr4STl2s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/homjkmw6llp7gwbotluy.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then give the text color in &lt;em&gt;RGB&lt;/em&gt;. Then in &lt;em&gt;font&lt;/em&gt; variable type the font name you want to use and using comma type the &lt;em&gt;font size&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;In the last line, you see the code&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;im.save("certificate_" + i + ".pdf")
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;It will save all your certificates in PDF manner. Here &lt;em&gt;i&lt;/em&gt; is the name to the attendee. It will save like &lt;em&gt;certificate_Rahul Sinha.pdf&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Note - All the PDF file save where your python code will be.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's run our code and see the output.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D_ujA10C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/93rc03zus2ejk95gt4z9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D_ujA10C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/93rc03zus2ejk95gt4z9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see in the image all the names in the excel sheet have been printed. Let's see the final output by opening the PDF.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b9vtrnqk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lwn5k2ityvlx3ctbyzl1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b9vtrnqk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lwn5k2ityvlx3ctbyzl1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Here is repo on GitHub of this code
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vWogaON8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-28d89282e0daa1e2496205e2f218a44c755b0dd6536bbadf5ed5a44a7ca54716.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/rahulsinha036"&gt;
        rahulsinha036
      &lt;/a&gt; / &lt;a href="https://github.com/rahulsinha036/Generate-Certificate-using-Python3"&gt;
        Generate-Certificate-using-Python3
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A python script which helps to generate certificate for the attendee
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Generate-Certificate-using-Python3&lt;/h1&gt;
&lt;p&gt;A python script which helps to generate certificate for the attendee&lt;/p&gt;
&lt;/div&gt;

  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/rahulsinha036/Generate-Certificate-using-Python3"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Hurray!! You successfully generated your certificate using Python. I am a working GUI Certificate Generator Using Python. It will be an open-source project. If you love this blog do share with your friends and team-mates
&lt;/h3&gt;

</description>
      <category>python</category>
      <category>computerscience</category>
      <category>githubsdp</category>
      <category>github</category>
    </item>
    <item>
      <title>Commands of Git Bash every Github developer should know</title>
      <dc:creator>Rahul Sinha</dc:creator>
      <pubDate>Thu, 21 May 2020 05:22:24 +0000</pubDate>
      <link>https://dev.to/rahulsinha036/commands-of-git-bash-every-github-developer-should-know-m5m</link>
      <guid>https://dev.to/rahulsinha036/commands-of-git-bash-every-github-developer-should-know-m5m</guid>
      <description>&lt;p&gt;We all know what is &lt;strong&gt;Github?&lt;/strong&gt; As it is an online software hosting website. Then what do we understand by &lt;strong&gt;Git?&lt;/strong&gt; Git is a distributed version control system that keeps track of changes that you make to files and directories and it was created by Linus Torvalds in April 2005. It is &lt;strong&gt;open-source and free;&lt;/strong&gt; Anyone can see and contribute or modify in the source code. The Version Control system is also known as SCM or &lt;strong&gt;Source Code Manager&lt;/strong&gt;.&lt;br&gt;
What do we mean by the &lt;strong&gt;Distributed version control system?&lt;/strong&gt; In a very simple term that different users maintain their own repositories. There is no central repository. All repository is equal for git. &lt;/p&gt;
&lt;h2&gt;
  
  
  Changes are stored as changesets.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Track changes, not versions like V1, V2, etc.&lt;/li&gt;
&lt;li&gt;Changesets can be exchanged b/w repositories.&lt;/li&gt;
&lt;li&gt;No need to communicate with a central server.&lt;/li&gt;
&lt;li&gt;No network access required&lt;/li&gt;
&lt;li&gt;Encourages participation and forking(branch or divide) of projects.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Let's start with some Git command.
&lt;/h2&gt;

&lt;p&gt;Open your GitBash. To know the version of the git installs in your system.&lt;br&gt;
&lt;/p&gt;

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


&lt;p&gt;Now configure your user name and email address with git.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.name "your username"
git config --global user.email youremail@email.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;You can also choose your default &lt;em&gt;code editor&lt;/em&gt; by git. I am using VS code, you can add yours.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global core.editor "vscode.exe"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If you are seeing only black color and you want to colorize your git. Also, you use help to know more commands about git.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global color.ui true
git help
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;You can also see &lt;strong&gt;Git&lt;/strong&gt; repository in &lt;em&gt;Github&lt;/em&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vWogaON8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-28d89282e0daa1e2496205e2f218a44c755b0dd6536bbadf5ed5a44a7ca54716.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/git"&gt;
        git
      &lt;/a&gt; / &lt;a href="https://github.com/git/git"&gt;
        git
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a href="https://github.com/git/git/actions?query=branch%3Amaster+event%3Apush"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OA_-QnkN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/git/git/workflows/CI/PR/badge.svg" alt="Build status"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
Git - fast, scalable, distributed revision control system&lt;/h1&gt;
&lt;p&gt;Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.&lt;/p&gt;
&lt;p&gt;Git is an Open Source project covered by the GNU General Public
License version 2 (some parts of it are under different licenses
compatible with the GPLv2). It was originally written by Linus
Torvalds with help of a group of hackers around the net.&lt;/p&gt;
&lt;p&gt;Please read the file &lt;a href="https://raw.githubusercontent.com/git/git/master/INSTALL"&gt;INSTALL&lt;/a&gt; for installation instructions.&lt;/p&gt;
&lt;p&gt;Many Git online resources are accessible from &lt;a href="https://git-scm.com/" rel="nofollow"&gt;https://git-scm.com/&lt;/a&gt;
including full documentation and Git related tools.&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://raw.githubusercontent.com/git/git/master/Documentation/gittutorial.txt"&gt;Documentation/gittutorial.txt&lt;/a&gt; to get started, then see
&lt;a href="https://raw.githubusercontent.com/git/git/master/Documentation/giteveryday.txt"&gt;Documentation/giteveryday.txt&lt;/a&gt; for a useful minimum set of commands, and
&lt;code&gt;Documentation/git-&amp;lt;commandname&amp;gt;.txt&lt;/code&gt; for documentation of each command
If git has been correctly installed, then the tutorial can also be
read with &lt;code&gt;man gittutorial&lt;/code&gt; or &lt;code&gt;git help tutorial&lt;/code&gt;, and the
documentation of each command with …&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/git/git"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now Let's clone a repository on our computer. First sign-in in your GitHub account. Create a new repository there and copy the https link and just paste there using ctrl + v&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uiaJuL3H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/msp0tvtlf6dass94mvw7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uiaJuL3H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/msp0tvtlf6dass94mvw7.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd D:/ #change the directory to D:/ directory
mkdir Git #created a folder named Git
cd Git #come Git folder and clone it here
git clone https://github.com/rahulsinha036/gitrepo.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ImPQDTqN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/koie3g2fi3mzm0l3zui3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ImPQDTqN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/koie3g2fi3mzm0l3zui3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Come to gitrepo folder. Here we can see all the files and folder using ls -la command. In the gitrepo folder, you can .git folder where git is initialized and one README.md file which read me file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd gitrepo
git ls -la #it will show the all files and folder of Git directory
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Let's create some text files using touch command in the gitrepo folder. To add some values in that text file we can use code command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch newgit.txt #it will create a new txt file
code newgit.txt #it'll open in your default editor and add some txt.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;After some values in the text file, you can see the status of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---RkeosnW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hxk9nf99494pxswj24js.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---RkeosnW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hxk9nf99494pxswj24js.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
In this image, you can see newgit.txt in red color. It means that it has not been tracked by git and not committed yet. Let’s add to git and the commit…&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add . # dot means to git all the files to git
git add newgit.txt #you can use in this way also
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Before committing to the repository, we should now the workflow of git.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---0D607m9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zbbn4hch71qxnsmotc31.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---0D607m9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zbbn4hch71qxnsmotc31.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
There is three tree architecture of git → &lt;strong&gt;working directory&lt;/strong&gt; (your computer folder), &lt;strong&gt;staging area&lt;/strong&gt; (where you first add files to git), and &lt;strong&gt;local repo&lt;/strong&gt; or &lt;strong&gt;remote repo&lt;/strong&gt; (means when you commit the files to GitHub). Here local repo means your files will not directly be added to Github repo but you can see all tracks using locally with the same commands.&lt;br&gt;
Now, let's commit the files to GitHub. Here -m is for a commit message.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m "Initial Commit" newgit.txt
--&amp;gt;It will add your file to Github repo.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;To see all the commit you have done…&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log #it will show all your commit
git log -n 5 #it will limit the no of commit &amp;amp; show up to 5 only

git log --since=2020-05-10
--&amp;gt;It will show all the commit onwards 10th May 2020

git log --until=2020-05-10
--&amp;gt;It will show all the commit done till 10th May 2020

git log --author="Rahul" #You can search commit by using your name

git log --grep="Init" #You can search using commit message
--&amp;gt; grep stands for Global Searching for Regular Expressions

git help log #it will show all commands to use in git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If you have made some changes to the file and forgotten, here git can help you to review it all.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;But it shows changes only for the working directory, not for staged and local/remoter.
&lt;/li&gt;
&lt;/ul&gt;

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



&lt;p&gt;To also know the changes in the files in the staging area…&lt;br&gt;
&lt;/p&gt;

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



&lt;p&gt;There is also one shortcut for committing the file to the repo. As you know that first, we have to add our file to git then commit the file to the repo. We can skip that adding process…&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Note that this shortcut is only valid after first successful adding and committing the file. If you have made some changes and you want to skip the 2nd process and directly want to commit.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -am "Commit all the file"
--&amp;gt; Here a is for all and m is for a commit message
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;After committing the file, you get a unique code which is known as SHA-1 or Hash Value.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Git generates a checksum(Hash Value) for each changeset.&lt;/li&gt;
&lt;li&gt;Data integrity is fundamental&lt;/li&gt;
&lt;li&gt;Changing data would change checksum. It means each hash value is unique whenever we change some data&lt;/li&gt;
&lt;li&gt;The number generates 40 character hexadecimal string (0–9, A-F)
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--REAUE_Rz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/z0kt17y7qmqr4efxre25.png" alt="Alt Text"&gt;
There is one more command &lt;strong&gt;git show&lt;/strong&gt; to show all SHA-1 or hash value and it will also show all the changes you have done in the file.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git show
git show 30699c 
--&amp;gt; You can also use the first 6 char of hash value to show all the details of that commit.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q-HWPD0A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2z9fo4tmj0ji4yw99me4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q-HWPD0A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2z9fo4tmj0ji4yw99me4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Let's push the file to GitHub after committing and modifying the file.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Yqwu3eci--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/knngt1ii5vqmko6ywt2w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Yqwu3eci--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/knngt1ii5vqmko6ywt2w.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
You can see our newgit.txt has been uploaded to GitHub. There are more some commands and some of the most common ones are like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;--&amp;gt; to create one folder
mkdir newfolder
--&amp;gt; to move the file from one folder to another
git mv newgit.txt newfolder/newgit.txt
--&amp;gt; to rename the file
git mv newgit.txt newgitfile.txt
--&amp;gt; to remove the file from the working directory
git rm newgit.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Hurray!! You have learned some commands of git bash. Go and Try all these commands on your Git Bash.
&lt;/h2&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>computerscience</category>
      <category>vscode</category>
    </item>
  </channel>
</rss>
