Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Feb 042012

Remove un-staged files or directories from Git repository


To remove newly added files or directories under a Git repository (but un-staged yet), do:

# git clean -fdn

Check if the files/directories are really okay to remove. Then, execute the command again without the '-n'

# git clean -fd

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>