37.0k views
0 votes
Are new files that you create in a project automatically staged in git?
1) True
2) False

User Rob Lowe
by
7.6k points

1 Answer

5 votes

Final answer:

New files created in a Git project are not automatically staged; one must use the 'git add' command to stage them manually before committing. Option 2 is correct.

Step-by-step explanation:

When you create new files in a Git project, they are not automatically staged. Instead, you must manually add them to the staging area using the git add command before they can be included in a commit. This process is necessary because Git needs to know which changes you want to include in the next commit. Automatically staging new files would remove control from developers over what is included in a commit, which could lead to unintended changes being added.

No, new files that you create in a project are not automatically staged in Git. Staging a file means preparing it to be committed, or in other words, marking it as ready to be added to the repository. To stage a new file, you need to use the 'git add' command followed by the file name. This command explicitly tells Git to start tracking the file and include it in the next commit.

User Mark Jeronimus
by
8.6k points