Roots Discourse

Afraid of `git clean`

After merging in the latest trellis from master I noticed that it now also cleans up untracked files during deploy:


My first reaction to this is that I am afraid of this. How is it ensured that the uploads/ folder is spared from this?

Here’s what I was about to reply:

Those folders are all git ignored so they’re all ignored from this. This cleans untracked files from directories tracked in Git.

Then I noticed the -x option. From Git docs:

Don’t use the standard ignore rules (see gitignore(5)), but still use the ignore rules given with -e options from the command line. This allows removing all untracked files, including build products.

So uhh… you’re right to be afraid but I’m probably missing something myself here :thinking: If we were deleting people’s uploads I’m sure we’d have heard about it by now?? :sweat:

My guess: because we symlink the shared uploads directory into the release every deploy this isn’t affected.

1 Like