Git · Junior · Question 3 of 75

What does git add file.js do?

Explanation

git add copies the file's current state into the index. If you edit the file again after that, the new changes aren't staged until you run git add again.

Further reading

Problem with a question

Git · Junior · question 3

Test yourself

Take the Git · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz