Git: How to remove ignored files from your repository's directory
2017-03-28 19:37
621 查看
转自: https://makandracards.com/makandra/17529-git-how-to-remove-ignored-files-from-your-repository-s-directory
When you have files in your
want to get rid of them, e.g. because they clutter your file system.
While a regular
changes that:
COPY
If you want to see what would happen first, make sure to pass the
COPY
Clean even harder by passing the
also required by default) or
COPY
Careful: You may be ignoring local config files like
would also be removed. Use at your own risk.
When you have files in your
.gitignorethey won't be considered for changes, but still you might
want to get rid of them, e.g. because they clutter your file system.
While a regular
git cleanwill ignore them as well, passing the
-xswitch
changes that:
COPY
git clean -x
If you want to see what would happen first, make sure to pass the
-nswitch for a dry run:
COPY
git clean -xn
Clean even harder by passing the
-f(force cleaning under certain circumstances; I think this is
also required by default) or
-d(removes directories) switches:
COPY
git clean -xdf
Careful: You may be ignoring local config files like
database.ymlwhich
would also be removed. Use at your own risk.
相关文章推荐
- How to manually remove an infected file from your computer
- How to manually remove an infected file from your computer
- How do I remove files saying “old mode 100755 new mode 100644” from unstaged changes in Git?
- git 报错 How do I remove files saying “old mode 100755 new mode 100644” from unstaged changes in Git?
- How to load all files from directory using JQuery ?
- Linux恢复被删除的文件 How To Recover Deleted Files From Your Linux System
- How to remove Oracle Database from your computer---By Roger Gong
- How to remove Oracle Database from your computer---By Roger Gong
- How to remove Oracle Database from your computer---By Roger Gong
- git tip: How to undo an uncommitted change/deletion for a specific file in your working directory
- How to manually remove an infected file from your computer
- How to remove Oracle Database from your computer---By Roger Gong
- How to use TFTP to transfer files from develop board to your host server?
- How to remove Oracle Database from your computer---By Roger Gong
- How to remove Oracle Database from your computer---By Roger Gong
- How to remove Oracle Database from your computer---By Roger Gong
- How to collect information about your computer to troubleshoot performance issues -ZT from MS
- Sharing with Git,Learn how to use Git to share your Xcode projects
- How to extract controlfiles, datafiles, and archived logs from SMR backupsets without using RMAN
- How to remove a block from the particular page?