Privacy Policy
© 2025 linux101.dev

Git: Staging Commands

The staging area is a middle ground between your working directory and your repository. It allows you to build a snapshot of the changes you want to commit.

Add Files to Stage

Add a specific file

git add [file]

Adds a file to the staging area. Use `git add .` to add all modified and new files.

Remove Files from Staging

Remove a file from staging

git reset [file]

Unstages a file but keeps the changes in the working directory. This is useful if you accidentally added a file.

Remove from staging and repo

git rm [file]

Removes a file from the staging area and deletes it from the working directory.