<?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: Muhammad Bilal Ashiq</title>
    <description>The latest articles on DEV Community by Muhammad Bilal Ashiq (@methebilalashiq).</description>
    <link>https://dev.to/methebilalashiq</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%2F3011861%2F356cad4a-cbbf-42f6-95bd-58fc52f76706.png</url>
      <title>DEV Community: Muhammad Bilal Ashiq</title>
      <link>https://dev.to/methebilalashiq</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/methebilalashiq"/>
    <language>en</language>
    <item>
      <title>Git and GitHub</title>
      <dc:creator>Muhammad Bilal Ashiq</dc:creator>
      <pubDate>Tue, 22 Jul 2025 20:10:38 +0000</pubDate>
      <link>https://dev.to/methebilalashiq/git-and-github-4ecn</link>
      <guid>https://dev.to/methebilalashiq/git-and-github-4ecn</guid>
      <description>&lt;p&gt;Cheat Sheet of my practice and complete step by step guidance&lt;/p&gt;

&lt;h2&gt;
  
  
  🔸 Check my GitHub Repository 🔸
&lt;/h2&gt;

&lt;p&gt;→ Click here to check by &lt;a href="https://github.com/thecallmeBilalAshiq/Git-and-Github-Learning" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What exactly is going on here?&lt;/p&gt;

&lt;p&gt;🔹 Git is a distributed version control system designed for tracking changes in source code during software development. It allows multiple developers to collaborate on projects, managing versions and facilitating branching for parallel development.&lt;/p&gt;

&lt;p&gt;🔹 GitHub is a web-based platform built around Git, providing hosting for Git repositories. It enhances collaboration by offering features like issue tracking, pull requests for code review, and project management tools. GitHub is widely used for open-source projects and by teams to streamline development workflows and ensure code quality through collaboration and version control.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0l0olrbi3hy4gc6gj4s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0l0olrbi3hy4gc6gj4s.png" alt=" " width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation and Login
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;First of all Download Git Bash from Google Chrome by clicking on it &lt;a href="https://git-scm.com/downloads/win" rel="noopener noreferrer"&gt;Git Bash&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Open GitHub on chrome. Create your account via email and remember the username GitHub&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Create any Repository on Github then open VS code. Open terminal on it&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git config&lt;/code&gt;&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 "username"
git config --global user.email "useremail"
git clone
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;github repository to vs code&lt;/p&gt;

&lt;p&gt;Open Github Repository. Click on green coloured word written Code. Copy URL link of Repository.&lt;/p&gt;

&lt;p&gt;git clone Link_of_github_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/thecallmeBilalAshiq/Git-and-Github.git
cd Git-and-Github
code .      // to open in vs code
ls 
ls -a (To see all the files, also hidden ones )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Transfer Github Repository to VS Code&lt;/p&gt;

&lt;p&gt;git Status&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git status&lt;/code&gt;&lt;br&gt;
add is an (engagement stage)&lt;/p&gt;

&lt;p&gt;commit is a(wedding stage)&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add&lt;/code&gt;&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 .          // to add all new files
git add [file]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;add a file as it looks now to your next commit (stage)&lt;br&gt;
git commit&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 "[descriptive message]"
# commit your staged content as a new commit snapshot
git commit -m "New file added"
git push
&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 push origin main   # update from VS code to Repository
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Stages
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
1️⃣&lt;strong&gt;Untracked&lt;/strong&gt; — — we add new files, but no commit it,, it is untracked, either we write in it or not&lt;/p&gt;

&lt;p&gt;️2️⃣&lt;strong&gt;Modified&lt;/strong&gt; — — changed&lt;/p&gt;

&lt;p&gt;3️⃣ &lt;strong&gt;Staged&lt;/strong&gt; — — file is ready to be committed&lt;/p&gt;

&lt;p&gt;4️⃣ &lt;strong&gt;Un-modified&lt;/strong&gt; — — unchanged&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqyd2nvwdmvy0qradtew7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqyd2nvwdmvy0qradtew7.png" alt=" " width="800" height="733"&gt;&lt;/a&gt;&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

git reset [file]
git diff

git diff
# diff of what is changed but not staged
git diff - staged
# diff of what is staged but not yet commited
git log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  → to see all commmits
&lt;/h2&gt;



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

&lt;/div&gt;



&lt;h2&gt;
  
  
  ♀️ Detail about Branches♀️
&lt;/h2&gt;

&lt;p&gt;git 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
git branch -m new_name(rename the branch)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of it you can use it.&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;h1&gt;
  
  
  -&amp;gt; Write previous line for one times then you can only run this command.
&lt;/h1&gt;

&lt;p&gt;git push&lt;br&gt;
git checkout&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 newbranch   # to create new branch
git checkout newbranch      # for shifting to different branches) 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Delete a 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 -d bilalbranch ==&amp;gt; delete
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Method 01:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git diff main   # to check the difference between two branches
git merge main  # to merge new branch with the main branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Method 02 — via github&lt;/p&gt;

&lt;p&gt;PR (Pull Request) &lt;br&gt;
after merging on github - -&amp;gt;&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;p&gt;to update it on your computer.&lt;br&gt;
Undo anything, Undo any commit&lt;br&gt;
git reset&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
 git reset HEAD~1 ==&amp;gt; to undo last commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;git reset&lt;br&gt;
Fork&lt;br&gt;
Fork on github to get other people repositories&lt;br&gt;
Search their repository -&amp;gt; fork it -&amp;gt; complete &lt;br&gt;
-&amp;gt; now that person repository is your repository&lt;/p&gt;

&lt;h2&gt;
  
  
  🔵 → Certification ← 🔵
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://coursera.org/verify/DZ8JGT5UQ7Y3?source=post_page-----1b0cabe5ee6f---------------------------------------" rel="noopener noreferrer"&gt;Certificate of Introduction to Git and GitHub course from Google Coursera&lt;br&gt;
&lt;/a&gt;&lt;br&gt;
Completion Certificate for Introduction to Git and GitHub&lt;br&gt;
This certificate verifies my successful completion of Google's "Introduction to Git and GitHub" on Coursera&lt;br&gt;
coursera.org&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F89w49jejy7gp75vuu778.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F89w49jejy7gp75vuu778.png" alt=" " width="800" height="622"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>gitlab</category>
      <category>gitbash</category>
    </item>
  </channel>
</rss>
