GIT使用[git remove untracked working file]

使用GIT进行merge的时候,

git merge --no-ff master

如果merge之后出现问题, 想进行回退, 可以使用

git reset --hard HEAD 

 来回退到最新的版本, 这时使用git status 可能出现 Untrack file

$ git status
On branch fds_encrypt_conf
Your branch is up-to-date with 'origin/fds_encrypt_conf'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        database/etl/
        xxx/xxx.java
       xxx/xxxxx.java

 是因为merge后增加了一些文件和目录, 这时候想要清除掉, 可以使用 git clean 来做 一般加两个参数 -f(force) -d(directory)

$ git clean -fd
Removing database/etl/
Removing xxx/xxx.java
Removing xxxxx/xxx.java

 

posted @ 2015-01-05 15:19  zhwbqd  阅读(935)  评论(0编辑  收藏  举报