Git Tutorial
Git and GitHub
Git Contribute
Git Advanced
Git Undo
Git New Files
Git Adding New Files
let’s add some files, or create a new file using a text editor. Then save or move it to the folder that was just created.
For this example, let’s use a simple HTML file like this:
Example:
Hello World!
Hello world!
This is the first file in my new Git Repo.
Now save this as index.html
Return to the terminal and list the files in the current working directory:
ls list the files in the directory.
Then, check the Git status and see if it is a part of the repo:
[user @localhost] git status
On branch master
No commits
Untracked files:
(use “git add …” to include in what will be committed)
index.html
nothing added to commit but untracked files present .
Git knows the file but has not added it to the repository.
Files in the Git repository folder can be in one of the two states mentioned below:
Tracked – files that Git knows about and are added to the repository
Untracked – files that are in the working directory, but are not added to the repository