Member-only story

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.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Fredric Cliver
Fredric Cliver

Written by Fredric Cliver

13+ years in the digital trenches. I decode complex tech concepts into actionable insights, focusing on AI, Software Engineering, and emerging technologies.

No responses yet

Write a response