# Add files to Git repository

In 
Published 2022-12-03

This tutorial explains how you can add files to Git repository using Git Bash. This tutorial has an example as well.

Creating a Git Repository is an easy task. You can create a repository using Git Gui ar you can create a Git repository using Git Bash (from command line).

At this point you have a Git repository created, but nothing in it yet. However, you have a file ("new-file.txt") in the repository folder ("D:\MyGitRepo").

In this phase, the file status is "untracked" => the file is not in repository & not in the stage area.

If you want to put the file in the repository, you have to put the file in the stage area first. This can be done by "git add " command.

As you can see in the picture above, at point 3) you add the file to the stage area and when the command is completed, the file is in the stage area but it is not in the repository.

In order to move to file to the local repository, you have to run the "git commit" command (take a look at the point 5) ).

At this point if you enter into the Git Gui you see nothing as "unstaged" or "staged changes":

Now if you want, you can push the new changes to a remote repository like GitHub.