Loading lesson path
(or staging area ) is like a waiting room for your changes. You use it to tell Git exactly which files you want to include in your next commit. This gives you control over what goes into your project history. Here are some key commands for staging:
Formula
git add < file >
- Stage a file git add -- all or git add - AFormula
- See what is staged git restore -- staged < file >Formula
To add a file to the staging area, use git add < file >Example git add index.html Now index.html is staged. You can check what is staged with git status
Formula
(use "git restore -- staged < file >..." to unstage)new file: index.html Stage Multiple Files (
Formula
git add -- all, git add - A) You can stage all changes (new, modified, and deleted files) at once:
Example git add --all git add -A does the same thing as git add --all.
See which files are staged and ready to commit:
Formula
(use "git restore -- staged < file >..." to unstage)new file: README.md new file: bluestyle.css new file: index.html
If you staged a file by mistake, you can remove it from the staging area (unstage it) with:
Example git restore --staged index.html Now index.html is no longer staged. You can also use git reset HEAD index.html for the same effect.
Formula
Use git restore -- staged < file >to unstage it.
Formula
Just run git add < file >again before you commit.
Run git status to see what will be committed.