GIT使用[git remove untracked working file]

使用GIT进行merge的时候,java

git merge --no-ff master

若是merge以后出现问题, 想进行回退, 可使用git

git reset --hard HEAD 

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

$ 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)code

$ git clean -fd
Removing database/etl/
Removing xxx/xxx.java
Removing xxxxx/xxx.java
相关文章
相关标签/搜索