Does git support pure basket support?

It would be much more convenient for me to use git clean if I knew that I could undo the deletion if something went wrong.

Does he support the basket in any way, shape or form? If not, are there any workarounds that anyone knows about, such as an external tool that uses git clean -n to print files and then move them to the trash?

+6
source share
3 answers

Put recycle.exe in 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 
+3
source

No.

If you are worried about losing files, you are “dry” - this is really the only option:

 git clean -n 

or equivalent

 git clean --dry-run 

Git does not know the main desktop environment and probably never will.

Git GUIs can show you these files, but why do you want to move them to the trash? Just think about what you do before deleting files.

Alternatively, add the files to a separate branch in your repository, although this probably defeats the purpose of deleting them first.

0
source

No Unfortunately!! git does not have this privilege. Whatever disappears!

git clean -fdxn

Performs a dry run and shows you which files will be deleted if you run

And one more thing is that if you added files and somehow deleted these files. In this case, you can restore these files using the following command:

'git fsck --lost-found'

It's worth a try, but don't count too much.

0
source

Source: https://habr.com/ru/post/972013/


All Articles