Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see untracked files in git instead of untracked directory

Tags:

git status shows directory (e.g smaller_fc) is untracked. However, I want to see exactly which files inside the directories (e.g smaller_fc) are untracked.

I would like to know if .gitignore is indeed ignoring certain subdir inside smaller_fc dir.

Here is terminal output.

$ git status On branch master Your branch is ahead of 'origin/master' by 1 commit. (use "git push" to publish your local commits)

Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory)

modified:   .gitignore 

Untracked files: (use "git add ..." to include in what will be committed)

nets/models/500K_iterations/500K_iteration_eval.txt nets/models/from_solverstate_150K/ nets/models/pretrained_model/ nets/models/smaller_fc/ 

.gitignore file:

.cproject .project .pydevproject build *~ *.pyc *.caffemodel */solverstate/* 

directory structure:

root -models --model1 ---solverstate ----somefiles.txt --model2 ---solverstate ----anotherfiles.txt .gitignore 

Could not find it on google.

like image 870
Jumabek Alikhanov Avatar asked Aug 19 '16 02:08

Jumabek Alikhanov


People also ask

Why am I seeing untracked files in git?

Untracked files are the ones still not versioned—”tracked”—by Git. This is the state of new files you add to your repository. That basically means Git is aware the file exists, but still hasn't saved it in its internal database.


1 Answers

If git only shows that the directory is untracked, then every file in it (including files in subdirectories) is untracked.


If you have some ignored files in the directory, pass the -u flag when running git status (i.e., git status -u) to show the status of individual untracked files.

like image 118
mipadi Avatar answered Sep 19 '22 15:09

mipadi