<?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: Ibuya Kennedy</title>
    <description>The latest articles on DEV Community by Ibuya Kennedy (@ibuya_kennedy_bdba211496e).</description>
    <link>https://dev.to/ibuya_kennedy_bdba211496e</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%2F4071879%2F1ba8544a-ae97-49a8-a99f-06bb8d1ae240.png</url>
      <title>DEV Community: Ibuya Kennedy</title>
      <link>https://dev.to/ibuya_kennedy_bdba211496e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ibuya_kennedy_bdba211496e"/>
    <language>en</language>
    <item>
      <title>Understanding the Git Workflow: Working directory, staging, commit and push</title>
      <dc:creator>Ibuya Kennedy</dc:creator>
      <pubDate>Fri, 28 Aug 2026 07:56:41 +0000</pubDate>
      <link>https://dev.to/ibuya_kennedy_bdba211496e/understanding-the-git-workflow-working-directory-staging-commit-and-push-44c8</link>
      <guid>https://dev.to/ibuya_kennedy_bdba211496e/understanding-the-git-workflow-working-directory-staging-commit-and-push-44c8</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;During the onboarding phase of data science and analytics program at LuxDevHq, &lt;strong&gt;Git&lt;/strong&gt; and &lt;strong&gt;GitHub&lt;/strong&gt; were one of the most critical tools we learned that work together to manage projects.&lt;br&gt;
&lt;strong&gt;Git:&lt;/strong&gt; Is installed, runs on the computer and keeps track of changes made to the project.&lt;br&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; is an online service where you can store Git repositories, the account is created online.&lt;br&gt;
To connect both Git and GitHub we used &lt;strong&gt;Git Bash&lt;/strong&gt; and authenticated using &lt;strong&gt;SSH (Secure Shell)&lt;/strong&gt;, this ensures a secure seamless connection for transferring a project.&lt;/p&gt;
&lt;h2&gt;
  
  
  The stages of Git workflow
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Working directory
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Working directory&lt;/strong&gt; is a local workspace that is used to actively create and interact with files and folder in Git bash environment.&lt;br&gt;
We used the following commands to navigate the files and folders;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cd desktop&lt;/code&gt; to open desktop folder when you’re inside the user profile folder&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ls&lt;/code&gt; Listing all the files and folders&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Mkdir&lt;/code&gt; creating files and folders of your project&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Touch&lt;/code&gt; creating a README.md file that explains the contents of the project&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Echo&lt;/code&gt; typing content of README.md&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Nano&lt;/code&gt; typing longer version of content of README.md file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Cat README.md&lt;/code&gt; to see the content of README.md file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Git init&lt;/code&gt; initializing the directory as a git repository&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Git status&lt;/code&gt; helps to see if there are commits&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Staging
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;staging&lt;/strong&gt; area is where we selected and organized the specific changes in the working directory so as to include in the next checkpoint. Staging files prepares files and folders locally but does not upload anything to &lt;strong&gt;GitHub.&lt;/strong&gt;&lt;br&gt;
For example, we used the following commands for the files to be saved;&lt;br&gt;
&lt;code&gt;git add README.md&lt;/code&gt; to stage README.MD file&lt;br&gt;
&lt;code&gt;git add .&lt;/code&gt;  to stage all changes in the current directory at once ,and&lt;br&gt;
&lt;code&gt;git status&lt;/code&gt; list these files under &lt;em&gt;changes to be committed.&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Commit
&lt;/h3&gt;

&lt;p&gt;When we performed &lt;strong&gt;commit command&lt;/strong&gt;, Git takes whatever is currently in the staging area and saves it as a permanent local checkpoint called &lt;strong&gt;a commit&lt;/strong&gt;.&lt;br&gt;
Committing does not upload the files to &lt;strong&gt;GitHub&lt;/strong&gt;; it remains on the computer.&lt;br&gt;
Example: When we run the command&lt;br&gt;
&lt;/p&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;"Add Kenyan hospital health records analysis project
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Git&lt;/strong&gt; saved this snapshot locally, which we can always refer back to it later if needed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pushing
&lt;/h3&gt;

&lt;p&gt;Pushing uploads the local commits to the remote server so the work is safely backed and can be shared with others.&lt;br&gt;
When we run&lt;br&gt;
&lt;/p&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;p&gt;it connects the local branch to GitHub and upload the first commit and for subsequent changes like updating the README file later—we simply run &lt;code&gt;git push&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once all this process of &lt;strong&gt;staging&lt;/strong&gt;, &lt;strong&gt;commit&lt;/strong&gt; and &lt;strong&gt;push&lt;/strong&gt; is complete, refreshing the repository page on GitHub shows the project folders and files online. &lt;/p&gt;

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

&lt;p&gt;In conclusion we learned the Git workflow through memorizing and understanding this sequence&lt;br&gt;
&lt;code&gt;git status&lt;/code&gt; &lt;strong&gt;(Check)&lt;/strong&gt; --&amp;gt; &lt;code&gt;git add .&lt;/code&gt; &lt;strong&gt;(Prepare)&lt;/strong&gt; --&amp;gt; &lt;code&gt;git commit&lt;/code&gt; &lt;strong&gt;(Save checkpoint)&lt;/strong&gt; --&amp;gt; &lt;code&gt;git push&lt;/code&gt; &lt;strong&gt;(Upload)&lt;/strong&gt;&lt;/p&gt;

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