0

I have just cloned a repository in my local computer. Then I've created inside the folder a new file. When i run 'git st' the new file does not appear, not even as an untracked file.

How can i list new files I created inside my project, to add them after?

tirenweb
  • 30,963
  • 73
  • 183
  • 303

2 Answers2

1

could it be that it is in .gitignore ?

Markus Mikkolainen
  • 3,397
  • 18
  • 21
1

Normally, you should see the file unless

  • the folder holding the file is not yet added to the repo (in that case, you'll see only the folder when typing git status)
  • the file is contained in a .gitignore present in the folder holding the file
  • the file is contained in .gitignore
  • the file is contained in .git/info/exclude
  • the file is contained in your global .gitignore file (check with
    git config --global core.excludesfile)

To check whether your file is ignored by one of the ignore files, type

git status --ignored

This will also show ignored files.

Solutions for the five cases:

  • when the folder is not yet versioned, add it with git add folder_name. This will add the folder and all of it's files (unless they are ignored) to the index.
  • when the file is filtered by a .gitignore, modify that file so that your file to be added shows up when typing git status.
eckes
  • 64,417
  • 29
  • 168
  • 201