Skip to content

Instantly share code, notes, and snippets.

@nnennajohn
Last active April 5, 2019 12:46
Show Gist options
  • Save nnennajohn/82ffac14cf5d4e6c7813244b3ecb0426 to your computer and use it in GitHub Desktop.
Save nnennajohn/82ffac14cf5d4e6c7813244b3ecb0426 to your computer and use it in GitHub Desktop.
Remove git untracked files

When you add something into a .gitignore file, try this:

  git add [uncommitted changes you want to keep] && git commit
  git rm -r --cached .
  git add .
  git commit -m "fixed untracked files"

If you remove something from a .gitignore file, and the above steps don't work, try this:

  git add -f [files you want to track again]
  git commit -m "Refresh removing files from .gitignore file."

// For example, if you want the .java type file to be tracked again, // The command should be: // git add -f *.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment