Staging Changes in Git
Consider that in the e2e_tests
repository that you just initialized, there are some untracked files like pom.xml and files in the src directory.
Untracked files are files that Git does not know about yet. If you want Git to start tracking these files, you would need to add these files to the staging area. Read more about the different sections in Git here.
To add the changes to staging area, you can run the git add
command.
Let's say that you first want Git to start tracking only the pom.xml file. You can run the following command:
git add pom.xml
When you run this command, the changes in pom.xml file are moved to the staging area. Changes to be committed
is Git's way of saying that the changes are in staging area:
Similarly, you can stage the changes in the src directory by running the command:
git add src/
You can run the git status
command to check that all the files inside the src directory are now in the staging area and are tracked by Git: