您的位置:首页 > 其它

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 
.gitignore
 they 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 clean
 will ignore them as well, passing the 
-x
 switch
changes that:
COPY
git clean -x


If you want to see what would happen first, make sure to pass the 
-n
 switch 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.yml
 which
would also be removed. Use at your own risk.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐