Staging area in Git

Staging area in Git

staging area stands for the temporary area, in this stage, the files or code is ready to commit or the stage before committing .here in this stage we can create partial commits, edit files or modify files.preparing of a commit is called as the staging area

for better understanding we will see one example .for I have created a feature for limit login attempts, it needs five steps to complete

I have completed step 1 so stage it (add it)

I have completed step2 so stage it (add it)

but I have a problem with step 2 so I can check the last stage step2.

Staging entire file

git add <path>

the index is a staging area because it has changes that needed to commit to the repository. this acts as a middle layer for the working tree and repository.

Adding command (doesn’t update deleted files)

git add .

the above command is used to update any modified and newly created files to the staged area, deleted files are not considered for the staging area

Add command (doesn’t update new files)

git add -u

The above command is used to update any modified and deleted files to the staged area,newly created files are not considered for the staging area

Add every file

git add -A

The above command is used to update any kind of modified, deleted and newly created files to the staging area

Last updated on by vishal devxo