-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to avoid deleting files with same name? #204
Comments
Not only it happily deletes all your files of the given name but additionally I can't manage to get a log or report of the files BFG deleted this way. The file in the report folder is useless to me as it shows the file name as entered, something I already know. I can't find a way to show which files have been deleted. I tried BFG but because of these issues I had to back to the much more complicated git filter-branch. |
This is a long-standing feature-request, see #79, #12 . The lack of this feature is brought-about by the way BFG processes trees - it only looks at the filename within the tree it is processing, so the context provided by all parent trees to the root (i.e. the full file-path) is not considered. From memory, with some moderate amount of effort, this might be added. There would be some memory and/or execution-time performance costs for this. Someone might even contribute a patch for this? The alternative often used is to pre-parse the entire object database and get the blob IDs of blobs to be removed - that way you can select them by full paths. BFG then supports removal by blob ID, so you can remove very specific paths that way. |
Git-filter-repo is able to remove file given a path from the repo's root. It is recommended in git's own documentation on git-filter-branch. |
Ideally I would want to precisely specify the path of a given file to delete. If the file to be deleted is not the only one in its folder and there is a namesake file somewhere else in the project, then the history of both files will be gone after
bfg --delete-files xy.zzz
. Renaming the other file before runningbfg
will keep the other file, but also erase its history.Running The BFG has been great so far but I wonder why the simplest of use cases isn't covered. Shouldn't it be trivial given that globs against filenames do work?
The text was updated successfully, but these errors were encountered: