---
title: "Removing untracked files from your git working copy"
author: "夜鸣猪"
date: "2013-02-12T06:10:16Z"
tags: []
categories: ["编程语言"]
slug: "removing-untracked-files-from-your-git-working-copy"
draft: false
lastmod: "2013-02-12T06:10:16Z"
id: 1797913
url: "https://hlee.iteye.com/blog/1797913"
---

If you want to also remove directories, run 
```java
git clean -f -d
```
.

If you just want to remove ignored files, run 
```java
git clean -f -X
```
.

If you want to remove ignored as well as non-ignored files, run 
```java
git clean -f -x
```
.