<?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: Nigel John Angel</title>
    <description>The latest articles on DEV Community by Nigel John Angel (@nigeljohnangel).</description>
    <link>https://dev.to/nigeljohnangel</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%2F3783316%2F7501e859-fd23-440a-9621-34e56059e7ae.jpg</url>
      <title>DEV Community: Nigel John Angel</title>
      <link>https://dev.to/nigeljohnangel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nigeljohnangel"/>
    <language>en</language>
    <item>
      <title>Software Development 101: A Crash Course in Version Control with Git and Github</title>
      <dc:creator>Nigel John Angel</dc:creator>
      <pubDate>Sun, 22 Feb 2026 15:51:18 +0000</pubDate>
      <link>https://dev.to/up_min_sparcs/software-development-101-an-introduction-to-version-control-with-git-and-github-o3o</link>
      <guid>https://dev.to/up_min_sparcs/software-development-101-an-introduction-to-version-control-with-git-and-github-o3o</guid>
      <description>&lt;p&gt;This article was co-authored by Nicole Marie Eduliantes&lt;/p&gt;

&lt;p&gt;Ever tried sending code to your groupmates via Messenger? Or maybe even Discord? Yep… we’ve been there. And trust us, it was not pretty.&lt;/p&gt;

&lt;p&gt;Writing code on your own is a breeze. Open your text editor, fire up Python, C, C++, or even whip up a quick webpage with HTML and CSS — easy peasy. But once you start working with others… that’s the exciting part. &lt;em&gt;(Can you feel the sarcasm through the screen?)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every CS first-year knows the classic horror story: your program works perfectly on your computer, but the moment your groupmates compile it… suddenly your debugger looks like a crime scene. Ask any freshie — they’ve all been through it.&lt;/p&gt;

&lt;p&gt;After surviving the tragedy that was our CMSC 18 final project, we decided to save others from the same fate. That’s why we created this step-by-step guide for anyone — CS freshie or not — who’s ever faced the terror of group coding.&lt;/p&gt;

&lt;p&gt;This guide is beginner-friendly and covers all the essentials of version control, plus how to implement it using Git and GitHub. And yes, if you’re still wondering what the difference between Git and GitHub is… don’t worry, that’s another canon event for every student out there.&lt;/p&gt;

&lt;p&gt;So buckle up! We’re about to take you from a complete version control noob to a Git-and-GitHub master.&lt;/p&gt;




&lt;h3&gt;
  
  
  Table of Contents
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Section 1: Introduction to Version Control&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What Is Version Control?&lt;/li&gt;
&lt;li&gt;What Are the Advantages of Implementing Version Control?&lt;/li&gt;
&lt;li&gt;What Is a Version Control System (VCS)?&lt;/li&gt;
&lt;li&gt;What Is a Distributed Version Control System (DVCS)?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Section 2: Introduction to Git and GitHub&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What Is Git?&lt;/li&gt;
&lt;li&gt;Git Components&lt;/li&gt;
&lt;li&gt;What Is GitHub?&lt;/li&gt;
&lt;li&gt;GitHub Concepts&lt;/li&gt;
&lt;li&gt;What Is the Difference Between Git and GitHub?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Section 3: Setting Up Git and GitHub&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setting Up Git&lt;/li&gt;
&lt;li&gt;Creating a Git Repository&lt;/li&gt;
&lt;li&gt;Setting Up GitHub&lt;/li&gt;
&lt;li&gt;Creating a GitHub Repository&lt;/li&gt;
&lt;li&gt;Remote Repository Configuration&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Section 4: Utilizing Git and GitHub&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Git Commands and More Concepts&lt;/li&gt;
&lt;li&gt;Other Useful Commands&lt;/li&gt;
&lt;li&gt;Copying a Repository&lt;/li&gt;
&lt;li&gt;Managing Changes&lt;/li&gt;
&lt;li&gt;Synchronizing Your Code&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Section 1: Introduction to Version Control
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What Is Version Control?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Version control&lt;/strong&gt;, also known as &lt;strong&gt;source control&lt;/strong&gt;, is the practice of tracking and managing changes made to source code over time. It allows developers to maintain a detailed history of modifications while establishing a central repository that serves as the authoritative version of the project.&lt;/p&gt;

&lt;p&gt;This shared reference makes it the perfect solution for collaborative coding, as it helps teams monitor updates, ensures that everyone works on a consistent and up-to-date version of the same source code, and provides a way to manage conflicting changes.&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%2Fm83o7i6sa714h3duwhuz.jpg" 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%2Fm83o7i6sa714h3duwhuz.jpg" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Attribution: SFDC Panther+&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  What Are the Advantages of Implementing Version Control?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Collaboration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Version control allows multiple developers to work on the same project simultaneously without interfering with one another by maintaining a shared repository. It also helps detect overlapping changes, making merge conflicts easier to identify and resolve efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Traceability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Implementing version control preserves a comprehensive history of changes, allowing developers to review past modifications and revert the codebase when errors occur or when specific changes need to be undone. It also provides information on when the changes were made, who made them, and why they were made, enhancing the program’s readability and scalability, especially for long-term development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Debugging&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Version control facilitates the debugging process by enabling developers to systematically identify which specific code modifications contributed to the occurrence of bugs and errors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Version control also enables the automation of software releases through Continuous Integration (CI) and Continuous Delivery (CD) workflows. These CI/CD tools can automatically build, test, and deploy new versions of the software whenever updates are pushed.&lt;/p&gt;




&lt;p&gt;Now that we know what version control is, the question remains:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;How do we put it into practice?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Enter &lt;strong&gt;Version Control Systems (VCS)&lt;/strong&gt; — the essential tools that bring version control to life.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is a Version Control System (VCS)?
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;Version Control System (VCS)&lt;/strong&gt; lets you manage your code’s history.&lt;/p&gt;

&lt;p&gt;Think of it as a Time Stone on steroids — granting god-like control over your code’s timeline. You can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create new timelines (branches)&lt;/li&gt;
&lt;li&gt;Rewrite history (modify commits)&lt;/li&gt;
&lt;li&gt;Erase realities (delete commits)&lt;/li&gt;
&lt;li&gt;Merge alternate timelines safely&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Teams collaborate via pull requests, reviewing and approving changes before merging into the main timeline. Every action is tracked, giving you full power to shape, reshape, or reset your code with precision and confidence.&lt;/p&gt;

&lt;p&gt;There are several types of Version Control Systems, each with its own features and workflows. Since this article focuses on Git, we will take a closer look at &lt;strong&gt;Distributed Version Control Systems (DVCS)&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is a Distributed Version Control System (DVCS)?
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;Distributed Version Control System (DVCS)&lt;/strong&gt; is a type of VCS in which developers create a full local copy of the repository by cloning the original source code.&lt;/p&gt;

&lt;p&gt;This allows them to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Commit changes locally&lt;/li&gt;
&lt;li&gt;Create branches&lt;/li&gt;
&lt;li&gt;Perform merges&lt;/li&gt;
&lt;li&gt;Experiment safely&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All without accidentally modifying the main repository.&lt;/p&gt;

&lt;p&gt;By working locally, developers can experiment and manage their changes safely before sharing them with the team. For this reason, DVCS is best suited for projects requiring high collaboration and the ability to work offline.&lt;/p&gt;

&lt;p&gt;Now that we’re done with all the “boring” introductory concepts, let’s dive into the world of Git.&lt;/p&gt;




&lt;h2&gt;
  
  
  Section 2: Introduction to Git and GitHub
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What Is Git?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Git&lt;/strong&gt; is a free and open-source Distributed Version Control System (DVCS) created by &lt;strong&gt;Linus Torvalds&lt;/strong&gt; in 2005. It is currently maintained by a team of open-source contributors led by &lt;strong&gt;Junio Hamano&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Today, Git is one of the most widely used VCS tools in the tech community, renowned for its speed, flexibility, and suitability for collaborative development.&lt;/p&gt;




&lt;h3&gt;
  
  
  Git Components
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Repository&lt;/strong&gt; – Contains all files, folders, and history of a project&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remote Repository&lt;/strong&gt; – Repository on a server accessible by the team&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Repository&lt;/strong&gt; – Copy stored on your computer&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Working Tree&lt;/strong&gt; – Project folder where you edit files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Branch&lt;/strong&gt; – Separate line of development&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Branch&lt;/strong&gt; – Branch in your local repository&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remote Branch&lt;/strong&gt; – Branch on the remote repository&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Staging Area&lt;/strong&gt; – Area where changes are prepared before committing&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  What Is GitHub?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt; is a cloud-based platform that hosts remote repositories and uses Git as its version control system.&lt;/p&gt;

&lt;p&gt;It allows developers to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;View code&lt;/li&gt;
&lt;li&gt;Share projects&lt;/li&gt;
&lt;li&gt;Collaborate through pull requests&lt;/li&gt;
&lt;li&gt;Manage workflows&lt;/li&gt;
&lt;li&gt;Review changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Beyond storage, GitHub provides tools — including AI-powered features — that help teams collaborate more efficiently.&lt;/p&gt;




&lt;h3&gt;
  
  
  GitHub Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Remote Repository&lt;/strong&gt; – Repository hosted on GitHub&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fork&lt;/strong&gt; – Copy of someone else’s repository under your account&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clone&lt;/strong&gt; – Downloading a local copy of a repository&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pull Request (PR)&lt;/strong&gt; – Request to merge changes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upstream&lt;/strong&gt; – Original repository you forked&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Syncing / Pulling from Upstream&lt;/strong&gt; – Updating your fork with changes&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  What Is the Difference Between Git and GitHub?
&lt;/h3&gt;

&lt;p&gt;In simple terms, &lt;strong&gt;Git&lt;/strong&gt; is the Version Control System (VCS) that manages changes in code, while &lt;strong&gt;GitHub&lt;/strong&gt; is a cloud-based platform where developers host and share their remote repositories. The actual version control process is carried out using Git, with GitHub serving as a place to store and collaborate on those repositories&lt;/p&gt;

&lt;p&gt;Git performs version control.&lt;br&gt;
GitHub facilitates collaboration.&lt;/p&gt;


&lt;h2&gt;
  
  
  Section 3: Setting Up Git and GitHub
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Setting Up Git
&lt;/h3&gt;
&lt;h4&gt;
  
  
  Step 1: Download Git
&lt;/h4&gt;

&lt;p&gt;Download Git based on your operating system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://git-scm.com/install/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 2: Open Git Bash (or Terminal)
&lt;/h4&gt;

&lt;p&gt;After installation, open:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Git Bash&lt;/strong&gt; (Windows)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Terminal&lt;/strong&gt; (Mac/Linux)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Step 3: Configure Your Identity
&lt;/h4&gt;

&lt;p&gt;Run the following commands to configure your global Git identity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"youremail@example.com"&lt;/span&gt;

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This ensures that your commits are properly labeled.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Step 4: Set Default Editor (Optional but Recommended)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; core.editor &lt;span class="s2"&gt;"code --wait"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This sets Visual Studio Code as your default Git editor.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Step 5: Set &lt;code&gt;main&lt;/code&gt; as Default Branch Name
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; init.defaultBranch main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This ensures all new Git repositories use &lt;code&gt;main&lt;/code&gt; as the default branch.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Step 6: Verify Your Global Configuration
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; &lt;span class="nt"&gt;--list&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensure the following appear:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user.name=Your Name
user.email=youremail@example.com
core.editor=code --wait
init.defaultbranch=main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Creating a Git Repository
&lt;/h3&gt;

&lt;p&gt;In this section, we will create a &lt;strong&gt;Git repository&lt;/strong&gt;. This is a &lt;strong&gt;local repository&lt;/strong&gt; that exists only on your computer and cannot be accessed by other devices unless you push it to a remote repository such as GitHub.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 1: Create or Choose a Project Folder
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Create a new project folder or choose an existing one.&lt;/li&gt;
&lt;li&gt;Copy its file path.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Step 2: Navigate to Your Project Folder
&lt;/h4&gt;

&lt;p&gt;Open Git Bash and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;filepath]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your working directory should now display your selected folder path.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 3: Initialize a Git Repository
&lt;/h4&gt;



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

&lt;/div&gt;



&lt;p&gt;You should see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Initialized empty Git repository in [filepath]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 4: Create a Python File (&lt;code&gt;app.py&lt;/code&gt;)
&lt;/h4&gt;

&lt;p&gt;In your code editor, open your project folder and create a file named app.py with the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;! Welcome to Git.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;user_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Beginner&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_name&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 5: Create a &lt;code&gt;.gitignore&lt;/code&gt; File
&lt;/h4&gt;

&lt;p&gt;Create a file named &lt;code&gt;.gitignore&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This .gitignore file is important since there might be files in our project folder that we don’t want to include in our repository. It tells Git which files and folders should be ignored and not added to commits.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Step 6: Create a &lt;code&gt;.env&lt;/code&gt; File (Simulating Sensitive Data)
&lt;/h4&gt;

&lt;p&gt;Create a file named &lt;code&gt;.env&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For this demonstration, pretend it contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Secret keys&lt;/li&gt;
&lt;li&gt;API keys&lt;/li&gt;
&lt;li&gt;Passwords&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These should never be committed.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 7: Configure &lt;code&gt;.gitignore&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;Paste the following into your &lt;code&gt;.gitignore&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Ignore environment files&lt;/span&gt;
.env

&lt;span class="c"&gt;# Python cache&lt;/span&gt;
__pycache__/
&lt;span class="k"&gt;*&lt;/span&gt;.pyc

&lt;span class="c"&gt;# Virtual environments&lt;/span&gt;
venv/
.env/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This ensures that sensitive files and unnecessary system-generated files are not tracked by Git.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Step 8: Stage Your Files
&lt;/h4&gt;



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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This will add all new and modified files, excluding those specific in .gitignore, to the staging area.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Step 9: Create Your First Commit
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"first commit"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This records the changes in the staging area as a new commit in Git’s history. Each commit acts like a save point, so you can later view or restore your project to a previous state if needed.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Step 10: Verify Your Commit History
&lt;/h4&gt;



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

&lt;/div&gt;



&lt;p&gt;You should see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Author&lt;/li&gt;
&lt;li&gt;Date&lt;/li&gt;
&lt;li&gt;Commit message&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Setting Up GitHub
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Step 1: Create a GitHub Account
&lt;/h4&gt;

&lt;p&gt;Go to:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Click &lt;strong&gt;Sign Up&lt;/strong&gt; and complete registration.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 2: Setting Up an SSH Key (Optional but Recommended)
&lt;/h4&gt;

&lt;p&gt;Before setting up an SSH key, let’s first understand what it is. This step is optional, since you can also use HTTPS instead of SSH, though SSH is a more secure option.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SSH (Secure Shell)&lt;/strong&gt; - This is a network protocol that lets one computer communicate securely with another over the internet by encrypting the connection to protect sensitive data. This enables developers to log in to servers, manage files, and run commands remotely.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;SSH Key&lt;/strong&gt; - A “password” used by the SSH to verify your identity. Configuring it to your Github account allows you to perform commands without having to type in your username and password each time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Private Key&lt;/strong&gt; – A secret key that stays on your computer and must never be shared.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public Key&lt;/strong&gt; – A “lock” that can be safely shared and can only be opened using the matching private key on your computer.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Think of Facebook:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Username = Public Key (safe to share)&lt;/li&gt;
&lt;li&gt;Password = Private Key (never share)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remember that it's "technically" safe to share your username with anyone (stranger danger). Your password, however, must stay secret because anyone who knows it can unlock your account and read all your messages, just like someone could break into an SSH connection if they had your private key.&lt;/p&gt;

&lt;p&gt;Follow this tutorial to generate your SSH key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://medium.com/@kyledeguzmanx/quick-step-by-step-guide-to-generating-an-ssh-key-in-github-d3c6f7e185bb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Creating a GitHub Repository
&lt;/h3&gt;

&lt;p&gt;We will now be creating a &lt;strong&gt;GitHub repository&lt;/strong&gt;, a &lt;strong&gt;remote repository&lt;/strong&gt; on the cloud that can be viewed and accessed by other people if the repository has been set to public.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 1: Create a New Repository
&lt;/h4&gt;

&lt;p&gt;Go to the following link and click on &lt;strong&gt;New Repository&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;https://github.com/new
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 2: Enter Repository Details
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Repository name&lt;/li&gt;
&lt;li&gt;Description (optional)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No need to modify default settings.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 3: Click Create Repository
&lt;/h4&gt;




&lt;h3&gt;
  
  
  Remote Repository Configuration
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Step 1: Copy Repository URL
&lt;/h4&gt;

&lt;p&gt;On your GitHub repository page:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click the &lt;strong&gt;Code&lt;/strong&gt; button&lt;/li&gt;
&lt;li&gt;Copy the HTTPS or SSH URL&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Step 2: Link Local Repository to Remote
&lt;/h4&gt;

&lt;p&gt;In Git Bash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add origin &lt;span class="o"&gt;[&lt;/span&gt;repository-url]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This connects your local Git project to the remote repository on GitHub.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Step 3: Rename Branch to &lt;code&gt;main&lt;/code&gt;
&lt;/h4&gt;



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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This renames your current branch to main.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Step 4: Push to GitHub
&lt;/h4&gt;



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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This uploads your local main branch to the remote repository on GitHub and sets it as the default branch for future pushes and pulls&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Step 5: Verify Upload
&lt;/h4&gt;

&lt;p&gt;Open your GitHub repository page.&lt;/p&gt;

&lt;p&gt;If your files appear under the &lt;code&gt;main&lt;/code&gt; branch, your push was successful. Notice that &lt;code&gt;.env&lt;/code&gt; was NOT uploaded — thanks to &lt;code&gt;.gitignore&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Section 4: Utilizing Git and GitHub
&lt;/h2&gt;

&lt;p&gt;In this section, we’ll dive deeper into how &lt;strong&gt;Git&lt;/strong&gt; and &lt;strong&gt;GitHub&lt;/strong&gt; are used in real-world &lt;strong&gt;collaborative coding&lt;/strong&gt;. We’ll explore key concepts and commands—and then put them into action by modifying a remote repository ourselves!&lt;/p&gt;

&lt;h3&gt;
  
  
  Git Commands and More Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Clone&lt;/strong&gt; – Copies a remote repository to your local machine.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &lt;span class="o"&gt;[&lt;/span&gt;repository-url]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Staging&lt;/strong&gt; – Adds changes to the staging area and tells Git which changes you want to include in the next commit.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="o"&gt;[&lt;/span&gt;filename]   &lt;span class="c"&gt;# Stages a specific file&lt;/span&gt;
git add &lt;span class="nb"&gt;.&lt;/span&gt;            &lt;span class="c"&gt;# Stages all changes in the current directory&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Commit&lt;/strong&gt; – Takes a snapshot of your staged changes and adds them to the project’s history. Each commit acts as a restore point you can backtrack to if needed.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"[message]"&lt;/span&gt;  &lt;span class="c"&gt;# Saves your staged changes with a commit message&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cherry-pick&lt;/strong&gt; – Applies a specific commit from another branch onto your current branch.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git cherry-pick &lt;span class="o"&gt;[&lt;/span&gt;commit-hash]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Status&lt;/strong&gt; – Shows the current state of your working directory and staging area.
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Commit History&lt;/strong&gt; – Displays the history of commits in your Git repository.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log                      &lt;span class="c"&gt;# Complete view of commit history&lt;/span&gt;
git log &lt;span class="nt"&gt;--oneline&lt;/span&gt;            &lt;span class="c"&gt;# Simplified view&lt;/span&gt;
git log &lt;span class="nt"&gt;--oneline&lt;/span&gt; &lt;span class="nt"&gt;--graph&lt;/span&gt; &lt;span class="nt"&gt;--all&lt;/span&gt;   &lt;span class="c"&gt;# Visual graph of commit history&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Branching&lt;/strong&gt; – Creates a separate line of work so you can develop features or fixes independently without affecting the main code.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch                   &lt;span class="c"&gt;# List branches&lt;/span&gt;
git branch &lt;span class="o"&gt;[&lt;/span&gt;branch-name]     &lt;span class="c"&gt;# Create a new branch&lt;/span&gt;
git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;branch-name]  &lt;span class="c"&gt;# Create a branch and switch to it&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Merge&lt;/strong&gt; – Combines changes from one branch into your current branch, creating a unified history.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git merge &lt;span class="o"&gt;[&lt;/span&gt;branch-name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Push&lt;/strong&gt; – Sends your local commits to the remote repository.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push &lt;span class="o"&gt;[&lt;/span&gt;remote-repo-name] &lt;span class="o"&gt;[&lt;/span&gt;branch-name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pull&lt;/strong&gt; – Downloads the latest changes from the remote repository and merges them into your current branch, updating your local code automatically.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull &lt;span class="o"&gt;[&lt;/span&gt;remote-repo-name] &lt;span class="o"&gt;[&lt;/span&gt;branch-name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fetch&lt;/strong&gt; – Downloads the latest changes from the remote repository to your local repository without merging, allowing you to review them first.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git fetch &lt;span class="o"&gt;[&lt;/span&gt;remote-name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rebase&lt;/strong&gt; – Reapplies commits from one branch onto another to maintain a linear history.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git rebase &lt;span class="o"&gt;[&lt;/span&gt;branch-name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Merge Error&lt;/strong&gt; – Occurs when two branches have changes to the same line of code (or overlapping changes in the same file) and Git cannot automatically determine which change to keep.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Other Useful Commands
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;git diff&lt;/strong&gt; – View unstaged changes.
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;git diff --staged&lt;/strong&gt; – View staged changes.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git diff &lt;span class="nt"&gt;--staged&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;git restore [file-name]&lt;/strong&gt; – Discard changes in a file.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git restore &lt;span class="o"&gt;[&lt;/span&gt;file-name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;git restore --staged [file-name]&lt;/strong&gt; – Unstage a specific file.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git restore &lt;span class="nt"&gt;--staged&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;file-name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;git reset&lt;/strong&gt; – Unstage all files.
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;git commit --amend&lt;/strong&gt; – Edit the last commit.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;--amend&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Copying a Repository
&lt;/h3&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%2Fz89d0uyxtlf6pg1c83jk.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%2Fz89d0uyxtlf6pg1c83jk.png" alt=" " width="565" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Attribution: dataschool.io&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This diagram illustrates the workflow of forking a repository, starting with &lt;strong&gt;Fork&lt;/strong&gt;, then &lt;strong&gt;Clone&lt;/strong&gt;, followed by &lt;strong&gt;Update&lt;/strong&gt;, &lt;strong&gt;Commit&lt;/strong&gt;, &lt;strong&gt;Push&lt;/strong&gt;, and ending with creating a &lt;strong&gt;Pull Request&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Open the &lt;strong&gt;demo repository&lt;/strong&gt; in your browser
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://github.com/lowCortisolDev/python-merge-demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This is the original (upstream) repository that you will copy and use for practice.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  2. Click the &lt;strong&gt;Fork&lt;/strong&gt; button at the top right of the page
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Forking creates your own copy of the repository under your GitHub account, letting you experiment freely without touching the original project. In real group projects, developers usually clone the repository directly. But for this demo, we’ll fork it so that you have a safe space to try things out.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  3. In the dialog that appears, click &lt;strong&gt;Create Fork&lt;/strong&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This generates your own remote repository copy that you fully control.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  4. Navigate to your &lt;strong&gt;forked repository&lt;/strong&gt; in your GitHub account
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;You are now viewing your personal remote version of the project. Any changes you make here won’t affect the original repository.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  5. Click the &lt;strong&gt;Code&lt;/strong&gt; button and copy the &lt;strong&gt;HTTPS&lt;/strong&gt; link
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This link will be used to clone (download) the repository to your computer.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  6. On your computer, create another folder named &lt;strong&gt;Demo&lt;/strong&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This folder will store your local repository files.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  7. Open &lt;strong&gt;Git Bash&lt;/strong&gt; (or your terminal) and navigate to the folder
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/Documents
&lt;span class="nb"&gt;cd &lt;/span&gt;Demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;You are moving your terminal into the directory where the repository will be cloned.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  8. Clone the repository using the link you copied in step 5
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;link&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;  &lt;span class="c"&gt;# Paste the link you copied in step 5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Cloning downloads the remote repository and creates a connected local Git repository on your computer.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  9. Navigate into the &lt;strong&gt;cloned repository&lt;/strong&gt; folder
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;You must enter the project directory before making changes. This now serves as your local repository&lt;/em&gt;. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  10. Open the repository in your &lt;strong&gt;Text Editor&lt;/strong&gt; (VS Code optional but recommended)
&lt;/h4&gt;



&lt;h3&gt;
  
  
  Managing Changes
&lt;/h3&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%2Fno4u3jgouaiq0cjyoltd.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%2Fno4u3jgouaiq0cjyoltd.png" alt="Git Diagram" width="800" height="746"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Attribution: Amazon Web Services (AWS)&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This diagram shows how changes move between your &lt;strong&gt;working tree&lt;/strong&gt;, &lt;strong&gt;staging area&lt;/strong&gt;, &lt;strong&gt;local branches&lt;/strong&gt;, and the &lt;strong&gt;remote repository&lt;/strong&gt; in Git.&lt;/p&gt;
&lt;h4&gt;
  
  
  1. &lt;strong&gt;Pull&lt;/strong&gt; the cloned repository on your local Git repository
&lt;/h4&gt;


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

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Ensures your local repository is synchronized with the latest changes from GitHub before starting new work. This is important as accidentally working on an outdated version will cause a Merge Conflict later on.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  2. Create a &lt;strong&gt;Second Feature Branch&lt;/strong&gt; on your local Git repository
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout main
git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; feature-analytics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Here, you are switching to &lt;code&gt;main&lt;/code&gt;, and then creating a new branch stemming out of it. The new branch will allow you to develop new features without affecting the main branch.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  3. Modify &lt;code&gt;app.py&lt;/code&gt; from &lt;strong&gt;feature-analytics&lt;/strong&gt; branch
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This allows you to implement the analytics feature in an isolated development branch. Make sure to modify an existing line of code to demonstrate a merge error.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  4. &lt;strong&gt;Stage&lt;/strong&gt;, &lt;strong&gt;commit&lt;/strong&gt;, and &lt;strong&gt;push&lt;/strong&gt; the changes in &lt;code&gt;feature-analytics&lt;/code&gt; branch
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add analytics feature"&lt;/span&gt;
git push origin feature-analytics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;git add&lt;/code&gt; moves changes to the staging area, &lt;code&gt;git commit&lt;/code&gt; saves changes locally, and &lt;code&gt;git push&lt;/code&gt; uploads the branch to GitHub.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  5. Merge Two Feature Branches towards the main branch via Pull Request
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;A Pull Request allows you to review and merge changes safely on GitHub.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  6. Go to your GitHub repository and open the &lt;strong&gt;Pull requests&lt;/strong&gt; tab
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This is where branch comparisons and merges happen&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  7. Click &lt;strong&gt;New pull request&lt;/strong&gt;
&lt;/h4&gt;
&lt;h4&gt;
  
  
  8. Set Base to &lt;strong&gt;main&lt;/strong&gt; and Compare to &lt;strong&gt;feature-analytics&lt;/strong&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This means that you are requesting to merge the feature branch into the main branch.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  9. Click &lt;strong&gt;Create pull request&lt;/strong&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This submits the request for review and merging.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  10. Click &lt;strong&gt;Merge pull request&lt;/strong&gt;, then &lt;strong&gt;Confirm merge&lt;/strong&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;If no conflicts exist, GitHub automatically merges the branch into &lt;code&gt;main&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  11. Repeat the process but merge &lt;strong&gt;feature-logging&lt;/strong&gt; into &lt;strong&gt;main&lt;/strong&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This will result in a Merge Conflict because we deliberately made both branches modify the same line of code.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  12. Click &lt;strong&gt;Resolve conflicts&lt;/strong&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This will allow you to see conflicting sections that must be manually resolved.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  13. Resolve the Conflict in &lt;strong&gt;GitHub Editor&lt;/strong&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;You must manually combine both versions and remove conflict markers (&lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/code&gt;, &lt;code&gt;=======&lt;/code&gt;, &lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt;). Ensure the final code contains both logging and analytics features correctly.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  14. Click &lt;strong&gt;Mark as resolved&lt;/strong&gt;, then click &lt;strong&gt;Commit merge&lt;/strong&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This will confirm that the conflict has been properly fixed.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  15. Click &lt;strong&gt;Merge pull request&lt;/strong&gt;, then &lt;strong&gt;Confirm merge&lt;/strong&gt;
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The feature branch is now successfully merged into &lt;code&gt;main&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;



&lt;h3&gt;
  
  
  Synchronizing Your Code
&lt;/h3&gt;

&lt;p&gt;After merging the two feature branches using a Pull Request, your local repository may not yet reflect the latest changes from GitHub.&lt;/p&gt;
&lt;h4&gt;
  
  
  1. Switch to the main branch
&lt;/h4&gt;


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

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;We need to switch to the main branch first because we’re about to pull the latest changes from the remote repository into our local main branch.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  2. Pull the latest changes from GitHub
&lt;/h4&gt;


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

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Now, our local main branch is completely up to date with the remote version.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  3. Delete the merged branches locally (Optional but recommended)
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-d&lt;/span&gt; feature-logging
git branch &lt;span class="nt"&gt;-d&lt;/span&gt; feature-analytics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;You can delete these branches in our local repository to remove clutter. These branches are no longer needed since the changes in these branches have already been applied to main.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  4. Delete the merged branches on GitHub (Optional)
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin &lt;span class="nt"&gt;--delete&lt;/span&gt; feature-logging
git push origin &lt;span class="nt"&gt;--delete&lt;/span&gt; feature-analytics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This is similar to the previous step, but this will delete the branches in the remote repository.&lt;/em&gt; &lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  5. Verify your branch status
&lt;/h4&gt;


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

&lt;/div&gt;


&lt;p&gt;You should now see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;*&lt;/span&gt; main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This confirms that only the &lt;code&gt;main&lt;/code&gt; branch remains and your repository is fully synchronized.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Your repository is now fully updated, clean, and ready for your next feature&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Congratulations&lt;/strong&gt;!
&lt;/h2&gt;

&lt;p&gt;You’ve just completed &lt;strong&gt;Software Development 101: A Crash Course in Version Control with Git and GitHub&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;From understanding the basics of version control, to creating branches, resolving merge conflicts, and collaborating with GitHub, you’ve taken your first big steps toward mastering the tools that power modern software development.&lt;/p&gt;

&lt;p&gt;Whether you’re a complete beginner or just brushing up your skills, the knowledge you’ve gained here will make teamwork, code management, and project organization far easier—and way less stressful.&lt;/p&gt;

&lt;p&gt;Now go forth, commit boldly, merge wisely, and never fear a conflict again! &lt;/p&gt;




&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.atlassian.com/git/tutorials/what-is-version-control" rel="noopener noreferrer"&gt;https://www.atlassian.com/git/tutorials/what-is-version-control&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://about.gitlab.com/topics/version-control/" rel="noopener noreferrer"&gt;https://about.gitlab.com/topics/version-control/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/git/git_intro.asp?remote=github" rel="noopener noreferrer"&gt;https://www.w3schools.com/git/git_intro.asp?remote=github&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Cover Photo Attribution
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.biteinteractive.com/of-git-and-github-master-and-main/" rel="noopener noreferrer"&gt;https://www.biteinteractive.com/of-git-and-github-master-and-main/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
