How to check all your untracked git files in the terminal.

Fredric Cliver
2 min readFeb 15, 2023
Photo by Gabriel Heinzer on Unsplash

Sometimes, when you periodically change your machine. You’d never expected that you might lose your codes. Cause you always use git.

But how about you haven’t tracked a few essential files?

Pods folder and node_modules are no problem, but how about regular code or environment files?

That is, you need to be careful and do double-check.

Here is a command to check all of the untracked and ignored files

List ignored files

$ git ls-files . --ignored --exclude-standard --others

List untracked files

$ git ls-files . --exclude-standard --others

You can use grep with the invert option to see all untracked files except specific directories, such as the Pods directory.

$ git ls-files . --ignored --exclude-standard --others | grep -v Pods
including Pods directory
Excluding Pods directory

Don’t forget to check whether your repository is perfectly synced as follows as your expectancy.

--

--

Fredric Cliver

Majored in Physics, self-taught and worked in the IT industry as a Dev/Design/Planning for 11 years. And I had run my Startup for 3 years. I fancy a ☔️ 🇬🇧