Assuming that you have a created a respository by cloning or initialisation and you want to add content to the repository. Open a terminal and from the command prompt enter the following command:
$cd HelloWorld $echo "Hello, World" > index.html $git add index.html
First go into your working folder where the repository has been initialised, and create an index.html file with a text “Hello, World!” and then give the command git add to add the index.html file.
Please note when adding files to the repository it will not affect the latest version until you give it the commit command, I will discuss the commit command in my next post.
Next if you wish to add multiple files at the same time you can do the following:
$git add .
The dot or period “.” means all files that hasn’t been added to the repository.