Have you failed a job interview?
Send us your job interview questions and get correct answers.
How do you add changed files from your Git workspace to Staging Area (Index)?
Experience Level: Junior
Tags: GitSource control
Before you start adding changes to Staging area (Index), it is good idea to first check what changes you have in your workspace. This can be done by executing the following command from command line:
You can then add changes to Index by using
git add command.
The following command adds all changes from the current directory and all its children:
git add .
The following command adds all html files from the folder Views that have some changes:
git add Views\*.html
The following command adds file index.html:
git add index.html
Related Git job interview questions
What is the most basic Git workflow that you can use every day?GitSource control Junior
What is a workspace in Git?GitSource control Junior
What is .git folder?GitSource control Junior
How do you check what files are changed in your Git workspace?GitSource control Junior
What is Staging Area (or Index) in Git?GitSource control Junior