rtyley / bfg-repo-cleaner

Removes large or troublesome blobs like git-filter-branch does, but faster. And written in Scala
https://rtyley.github.io/bfg-repo-cleaner/
GNU General Public License v3.0
11k stars 547 forks source link

--delete-files doesn't seem to work #298

Closed DigiBee closed 5 years ago

DigiBee commented 5 years ago

I am trying to remove some.web.config in our repo using bfg. I tried to remove a static html and and bfg worked and it removed that file from all the commits. The problem is I cannot do it for any .config files in our project. I don't get any errors. Are there any issues removing config files?

DigiBee commented 5 years ago

I did a delete for web.config and what I've noticed is the web.config in the root directory was not deleted but the web.config inside a subdirectory got deleted and successfully removed from the GIT history. Is there any reason why that happened?

DigiBee commented 5 years ago

This is my command java -jar /d/bfg.jar --delete-files "{web.config,web.debug.config,web.staging.config,web.release.config}" --no-blob-protection

I've also tried doing a single file deletion command as well

javabrett commented 5 years ago

Do you have a shareable repo where this problem can be reproduced? BFG version?

DigiBee commented 5 years ago

Unfortunately all repos are private.

javabrett commented 5 years ago

Can you construct a trivial public repo which reproduces the problem?

DigiBee commented 5 years ago

I've created this public repo https://github.com/DigiBee/BfgTest.git

I was able to delete a static text file with no issues but I cannot remove the web configs still specifically web.config, web.release.config, web.debug.config

with message "BFG aborting: No refs to update"

javabrett commented 5 years ago

Have you tried Web.config etc.?

DigiBee commented 5 years ago

Yes I tried. It looks like it's successful but the config file is still there.

DigiBee commented 5 years ago

I am not sure but maybe it doesn't work for files that's been part of the first push?

javabrett commented 5 years ago

Works fine for me, these files are deleted. Maybe confirm the OS you are running on, the exact BFG version and the exact command lines you use, starting with cloning the repo.

DigiBee commented 5 years ago

I didn't clone the repo as this is just a test copy. I thought it's just optional. I am using windows 10 and I am using the latest version (I just downloaded the jar yesterday)

DigiBee commented 5 years ago

java -jar /d/bfg.jar --delete-files web.config --no-blob-protection git reflog --expire=now && git gc --prune=now --aggressive git push -f

javabrett commented 5 years ago

You keep typing web.config even though your repo file has proper case Web.config. Why do you do that? I mentioned Web.config above, have you tried it?

Try using a filesystem with proper case-sensitivity (not Windows), or configure Git to compensate.

Please pay attention to the case of your filenames.

DigiBee commented 5 years ago

This is basically a new repo I've committed for testing.

  1. I created a new project
  2. Created a new repo in github
  3. Committed my proj to the new repo
  4. ran the delete bfg command and push
DigiBee commented 5 years ago

Darn, apologies. I am not really thinking of case sensitivity. That worked. Thanks a lot. Let me try it in our actual repo.

javabrett commented 5 years ago

Please close this issue.