<?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: David kimethu</title>
    <description>The latest articles on DEV Community by David kimethu (@david_kimethu_f0d90d662ee).</description>
    <link>https://dev.to/david_kimethu_f0d90d662ee</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3708680%2F60f4f750-0e7d-4fc4-a692-ffe473277363.png</url>
      <title>DEV Community: David kimethu</title>
      <link>https://dev.to/david_kimethu_f0d90d662ee</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/david_kimethu_f0d90d662ee"/>
    <language>en</language>
    <item>
      <title>Understanding Pull and Push Operations on GitHub Using Git Bash</title>
      <dc:creator>David kimethu</dc:creator>
      <pubDate>Sun, 18 Jan 2026 19:02:57 +0000</pubDate>
      <link>https://dev.to/david_kimethu_f0d90d662ee/understanding-pull-and-push-operations-on-github-using-git-bash-aho</link>
      <guid>https://dev.to/david_kimethu_f0d90d662ee/understanding-pull-and-push-operations-on-github-using-git-bash-aho</guid>
      <description>&lt;p&gt;&lt;strong&gt;Pulling and Pushing Data from GitHub Using Git Bash&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;GitHub is widely used in software development to store and manage source code, while Git is the version control system that tracks changes made to that code. Git Bash is a command-line tool that allows users, especially those using Windows, to interact with Git and GitHub using text-based commands.&lt;/p&gt;

&lt;p&gt;This article explains how to pull data from GitHub and how to push data to GitHub using Git Bash, using simple language and practical examples to improve understanding.&lt;/p&gt;

&lt;p&gt;Understanding Pull and Push in Simple Terms&lt;/p&gt;

&lt;p&gt;In Git, a project usually exists in two places:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a local repository on a developer’s computer&lt;/li&gt;
&lt;li&gt;a remote repository on GitHub&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To keep these two copies synchronized, Git provides two main operations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pulling data&lt;/strong&gt; means downloading updates from GitHub to the local computer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pushing data&lt;/strong&gt; means uploading local changes from the computer to GitHub.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, if a teammate updates a file on GitHub, you must pull those changes to see them locally. If you update a file on your computer, you must push your changes so others can access them on GitHub.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accessing a GitHub Repository Using Git Bash&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Git Bash is used to run Git commands. After opening Git Bash, the user navigates to a working directory and connects to a GitHub repository.&lt;/p&gt;

&lt;p&gt;To download a repository from GitHub, the following command is used:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git clone https://github.com/username/repository-name.git&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command creates a local copy of the project and links it to the GitHub repository. The user then moves into the project folder:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd repository-name&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;At this point, the project is ready for pull and push operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pulling Data from GitHub Using Git Bash&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pulling data ensures that the local repository contains the most recent updates from GitHub.&lt;/p&gt;

&lt;p&gt;The basic command used to pull data is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git pull&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;When this command is executed, Git Bash connects to GitHub, checks for new changes, and downloads them into the local project.&lt;/p&gt;

&lt;p&gt;For example, if a new file named README.md was added to the GitHub repository by another developer, running git pull will automatically download that file to the local machine.&lt;/p&gt;

&lt;p&gt;If the branch needs to be specified explicitly, the command can be written as:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git pull origin main&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Pulling data regularly helps prevent conflicts and keeps the project up to date.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pushing Data to GitHub Using Git Bash&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pushing data is done after changes have been made locally and saved as a commit.&lt;/p&gt;

&lt;p&gt;First, the user checks which files have been modified:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git status&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Next, the modified files are staged:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The changes are then committed:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit -m "Update project documentation"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Finally, the committed data is pushed to GitHub:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For example, if a developer edits a file called index.html on their computer, pushing will upload the updated version of that file to the GitHub repository.&lt;/p&gt;

&lt;p&gt;If this is the first push, Git Bash may require setting an upstream branch:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push -u origin main&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Simple Example Workflow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A common and recommended workflow when using Git Bash is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pull the latest data from GitHub&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;git pull&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Make changes to files locally. &lt;/li&gt;
&lt;li&gt;Commit the changes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;git add .&lt;br&gt;
git commit -m "Fix layout issue"&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Push the data back to GitHub&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;git push&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This workflow ensures that the local and remote repositories remain synchronized.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Handling Conflicts During Pull and Push&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In some cases, Git may report a conflict when pulling or pushing data. This usually occurs when the same file has been edited both locally and on GitHub.&lt;/p&gt;

&lt;p&gt;Git will indicate the conflicting sections inside the file. The user must manually choose the correct version, save the file, and then complete the process by running:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add .&lt;br&gt;
git commit&lt;br&gt;
git push&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Resolving conflicts correctly allows the data to be pushed successfully.&lt;/p&gt;

</description>
      <category>gitbash</category>
      <category>github</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
