Re: git clean -Xdf affects parent and sibling directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/7/25 22:24, Junio C Hamano wrote:
The command should take the usual pathspec, so "git clean ." should work as expected.

Thank you for the explanations! I tried again with "git clean -Xf -- ." and this command still removes parent and sibling content. This seems to be at odds with the manual: "If any optional <pathspec>... arguments are given, only those paths that match the pathspec are affected."

As far as I can see, if <pathspec> is untracked and ignored, the command goes to the topmost ignored directory of the tree and cleans from there.

In the worst case, GIT_WORK_TREE=$HOME, GIT_DIR tracks dotfiles, and all other directories such as ~/Documents/ are ignored. Running the command in ~/Documents/path/to/another/repository/ would remove everything under ~/Documents/. (This is not exactly what I did; I did not lose any files. In any case, thanks for the advice to always do a dry run first!)

Jan




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux