git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git clean -fdx deletes tracked files

From
Kevin Daudt <me@ikke.info>
Date
Aug 15, 2017, 19:25 UTC
Message-ID
<20170815192543.GB3839@alpha.vpn.ikke.info>
In-Reply-To
<CAOCG=_p--J5PKGrQTdquMvcBNQs67MNaN3vM8Tbwn2nZNwVR+Q@mail.gmail.com>
On Tue, Aug 15, 2017 at 08:45:20PM +0200, Kim Birkelund wrote:
Show 30 quoted lines
> Hi
> 
> I hope this is gonna sound as weird to you as it does to me.
> 
> The link below is a zip of a small git repository that I can reproduce
> the bug in on 2 machines.
> 
> Repo: https://www.dropbox.com/s/fz4d0i5ko7s7ktr/test.zip?dl=0
> 
> It contains 2 folders: helpers and b, each of which is an empty npm
> module. b\package.json refers to the helpers module.
> 
> The following reproduces the bug:
> 
> 1) in terminal cd to the b folder
> 2) run npm install
> 3) run git reset HEAD --hard
> 4) run git clean -fdx
> 
> At this point both files in the helpers folder has been deleted and
> running git status confirms this.
> 
> Tool version:
> 
> git --version => git version 2.10.2.windows.1
> node -v => v6.11.2
> npm -v => 5.3.0
> 
> 
> I have no idea what is going. Very much hope you can explain :-)
I cannot reproduce it on linux.
git clean -fdx output:
  Removing node_modules/
  Removing package-lock.json

These are all untracked, and nothing in the helpers dir is being removed.

Previous: Kim BirkelundNext: Kim Birkelund
Message 2 of 4 in “git clean -fdx deletes tracked files”
  1. Kim BirkelundAug 15, 2017
  2. Kevin DaudtAug 15, 2017
  3. Kim BirkelundAug 16, 2017
  4. Andrew ArdillAug 17, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.