<?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: asma Salah</title>
    <description>The latest articles on DEV Community by asma Salah (@asma_salah_2e2a6926b57a2e).</description>
    <link>https://dev.to/asma_salah_2e2a6926b57a2e</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%2F4071774%2F84e31e95-9c9c-4456-a660-016bbe997796.png</url>
      <title>DEV Community: asma Salah</title>
      <link>https://dev.to/asma_salah_2e2a6926b57a2e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/asma_salah_2e2a6926b57a2e"/>
    <language>en</language>
    <item>
      <title>Understanding the Git Workflow: Working Directory, Staging, Commit and Push</title>
      <dc:creator>asma Salah</dc:creator>
      <pubDate>Thu, 27 Aug 2026 09:38:57 +0000</pubDate>
      <link>https://dev.to/asma_salah_2e2a6926b57a2e/understanding-the-git-workflow-working-directory-staging-commit-and-push-1402</link>
      <guid>https://dev.to/asma_salah_2e2a6926b57a2e/understanding-the-git-workflow-working-directory-staging-commit-and-push-1402</guid>
      <description>&lt;h2&gt;
  
  
  Working directory
&lt;/h2&gt;

&lt;p&gt;This is the local project folder; you can create it in the Git terminal by using the following: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;mkdir folderName&lt;/code&gt; command, for example, &lt;code&gt;mkdir luxDev&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;switching to that folder, we use &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cd folderName&lt;/code&gt; command.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To create a file in the folder, we use &lt;code&gt;type nul &amp;gt; fileName&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then in the event of making changes, we use Git to track the changes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git status&lt;/code&gt; command. This command will help us find the untracked changes in files.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Staging
&lt;/h2&gt;

&lt;p&gt;Staging lets you choose what exactly goes into your next commit.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git add .&lt;/code&gt; is used to stage all changes while, &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git add fileName&lt;/code&gt; if you want to save a single file or 2 to 3 files&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Commit
&lt;/h2&gt;

&lt;p&gt;This is where git records your staged changes to be permanent point in project history.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit -m "add folder setup and structured the first comment"&lt;/code&gt;&lt;br&gt;
A commit doesn't affect your working directory or your staging area; rather, it takes a snapshot of what's currently staged and locks it into history&lt;/p&gt;

&lt;p&gt;Git also gives you tools to actually see what's happening at each stage, which helped me trust the process instead of just following steps blindly.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git log&lt;/code&gt; shows the history of commits &lt;/p&gt;

&lt;p&gt;This prints each commit's unique ID, author, date, and message&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git diff&lt;/code&gt; shows exactly what changed in a file, line by line, before you commit it. This is what finally made the working directory.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git diff&lt;/code&gt;— shows changes in your working directory that are not yet staged&lt;br&gt;
&lt;code&gt;git diff --staged&lt;/code&gt; — shows changes that are staged, waiting to be committed&lt;/p&gt;

&lt;h2&gt;
  
  
  Push
&lt;/h2&gt;

&lt;p&gt;Everything above happens locally, on your own machine. Push is the step where your commit history gets sent to a remote repository (like GitHub), so it's backed up and shareable.&lt;/p&gt;

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

&lt;p&gt;This is the step that made Git "real" for me because before pushing, all my work exists only on my laptop. After pushing, it's on GitHub, visible to anyone I share the repo with, and safe even if my laptop dies tomorrow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Each stage answer a different question
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Working directory:&lt;/strong&gt; What am I currently changing?&lt;br&gt;
&lt;strong&gt;Staging:&lt;/strong&gt; What do I want to include in my next save point?&lt;br&gt;
&lt;strong&gt;Commit:&lt;/strong&gt; What's now permanently recorded in history?&lt;br&gt;
&lt;strong&gt;Push:&lt;/strong&gt; What's now shared with others?&lt;/p&gt;

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