Add another file
Repeat the process with another new file
Create a new file
Let us create a file called second.txt with one line in it, in the same directory as before and check the status now:
C:\...\GitExperiments\FirstDemo> ls
Directory:
C:\Users\ravi_\Source\repos\Experiments\GitExperiments\FirstDemo
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- Sat 04-02-2023 10:38 AM 6 hello.txt
-a---- Sat 04-02-2023 11:46 AM 10 second.txt
C:\...\GitExperiments\FirstDemo> git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
second.txt
nothing added to commit but untracked files present (use "git add" to track)
We can see that Git only shows the untracked files and nothing about the committed files!
Commit the new file
We can add all (untracked) files in one shot and then commit as follows
git add .
git commit -m "second file added"
[master 299930d] second file added
1 file changed, 1 insertion(+)
create mode 100644 second.txt
git status
On branch master
nothing to commit, working tree clean
Last updated