git clean是否支持转到回收站? [英] Does git clean support moving to Recycle Bin?

查看:276
本文介绍了git clean是否支持转到回收站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



它是否以任何方式支持回收站,如果我知道我可以在发生错误时撤销删除操作,形状还是形式?如果不是,是否有任何人知道的解决方法,例如使用 git clean -n 的外部工具来打印文件,然后将它们移动到回收站? / p>

解决方案

放置%PATH%



运行 git config --global alias.recycle!git_recycle.sh



将git_recycle.sh放入%PATH%中:

 #!/ bin / bash 

cd $ {GIT_PREFIX: - 。}
git clean -xdfn$ @| sed's /将删除//'| xargs -d \\ - 不运行如果空回收


I would feel much more comfortable using git clean if I knew I could undo the deletion in case something goes wrong.

Does it support Recycle Bin in any way, shape or form? If no, are there any workarounds that anyone knows of, such as an external tool using git clean -n to print out the files, and then moving them to Recycle Bin?

解决方案

Put recycle.exe into your %PATH%

Run git config --global alias.recycle !git_recycle.sh

Put git_recycle.sh in your %PATH%:

#!/bin/bash

cd ${GIT_PREFIX:-.}
git clean -xdfn "$@" | sed 's/Would remove //' | xargs -d \\n --no-run-if-empty recycle

这篇关于git clean是否支持转到回收站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆