FreeKB - git add command
Git - git add command

If you are not familiar with Git, check out our getting started article. These examples are based on Linux.

These examples are based on Linux. Let's say the root directory of your master Git repository is /var/git. Move into the root directory.

cd /var/git


Create a new file.

touch foo.txt


Add the new file to Git.

git add foo.txt


The git status command will now show that foo.txt is ready to be committed.

git status
. . .
Changes to be committed:
. . .
  new file: foo.txt


You would then commit the new file.

Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 9a6a6 in the box below so that we can be sure you are a human.