Urgent.News

What's breaking now, across thousands of outlets.

Tech

From MKDIR to GIT PUSH: What Actually Happens to a Project?

The first time you see a Git workflow, it can look like a list of commands you are supposed to memorize: git add. git commit -m "Initial commit" git push Three commands, and somehow the project ends up on GitHub. But what actually happens between creating a folder on your computer and seeing that project in a GitHub repository? The commands become much easier to understand when you stop treating…

When you first encounter a Git workflow, it can appear as a list of commands to memorize, such as git add, git commit -m "Initial commit", and git push. However, these commands are actually different stages in a workflow that transforms a local project into a version-controlled repository on GitHub. Understanding the stages between creating local files and pushing them to GitHub is crucial for grasping how Git works and how projects progress through different states.

1. Working Directory: The project begins as a directory on your computer. For example, you might create a folder called "git-workflow-demo" using the command `mkdir git-workflow-demo` and navigate into it. This directory can contain files like README.md and hello.py. At this stage, the files exist in the working directory, and Git has not yet started tracking the project.

2. git init: To start tracking the project, you initialize a Git repository by running `git init`. This creates the necessary Git metadata within the folder, allowing Git to begin managing the project's history. The directory now becomes a Git repository, and you can check its status with `git status`. This command provides information about the current state of the repository, such as which files have changed, are untracked, or are staged for commit.

3. Staging Area: The staging area is a critical intermediate step between the working directory and the local repository. It allows you to select which changes you want to record in the next commit. For instance, if README.md has been modified, you can stage it using `git add README.md`. This command tells Git to include the changes in the next commit. The staging area is where you prepare the files you wish to commit together, giving you control over the project's history.

4. git commit: Once you have staged the desired changes, you create a commit using `git commit -m "Add README"`. A commit is a snapshot of the project's state at a specific point in time, including all staged changes. This commit is stored in the local repository but has not yet been pushed to the remote GitHub repository. The local repository now contains a record of the staged changes, preparing them for sharing with others or backing up on GitHub.

5. git push: Finally, to share your project with the world or collaborate with others, you push your local commits to the remote GitHub repository using `git push`. This operation sends the committed changes to GitHub, making them available online. It is important to note that `git push` is a separate step from `git commit`, which only records changes locally.

Understanding these stages—working directory, staging area, local repository, and remote repository—provides a clear picture of Git's workflow. Each command has a specific role in moving the project from its initial state in the working directory to the version-controlled repository on GitHub. Recognizing how these commands interact and the state of the project at each stage helps demystify Git and makes the process more intuitive.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

MCP Security: Threat Model & Hardening Guide (2026)

Educational & Ethical Use Only — This article is provided for educational and ethical cybersecurity research purposes only.

  • Four distinct trust boundaries must be secured independently in MCP architecture.
  • Implement build-time tool allowlist and sandboxed execution environments to reduce tool layer risks.

Iranian hackers shut down UK power plant

A small power plant has been shut down during a cyber attack. The government said that at no point was there a risk to the UK’s energy system, but the Department for Energy Security and Net Zero…

  • UK power plant shut down for four days due to cyber attack
  • Attack attributed to Iranian hackers affiliated with the regime
  • Government updates cyber security regulations and energy resilience strategy

More from Sunday 23 August →