Adding files

Git Status

Imagine you added a text file to your repository called 'text.txt'.

Now use this command:
git status
This command shows you what has happened in your repository. Right now, they are saying that there is a new file in the repository and you need to stage it on git.

Adding files

To stage a file on git(as in, telling git a file should be added), we use this command:
git add filename
To add our file text.txt, you type:
git add text.txt

Now what if we added many files to the repository? To stage all files, just type '*' as filename, like this:
git add '*'
This will stage all the files you have added.

Previous page

Next page