"WL-INV-04.02.24_2024_00001-source-S2023-0004 - Case 313416, Assignment \"Imager P1\", SAP[4].pdf"
is causing git to hiccup and not push file changes to my bitbucket cloud. I have tried all the git commands to clean my local index. But this filename stays in the index and i cannot remove it.
My MAC allows the filename with ,"/ characters.
Any ideas on what to do, please?
Phil
Hi Phil and welcome to the community!
If the file exists on the last commit of a certain branch, and if this branch is not merged into any other branches, you can reset the last commit with the command
git reset --soft HEAD~1
Please note that this means you will lose all changes of the last commit.
Another option would be to completely remove this file from the repo's history with BFG repo cleaner:
That page includes step-by-step instructions and also an example of how to remove a certain file.
Please also check the section Your current files are sacred...; if you want BFG to to modify also the latest commit of the HEAD, you will need to run it with the option --no-blob-protection.
It's important to note that BFG rewrites history, which means that the hashes of the repo's commits will change. It's good to communicate this to any other users who may work on this repo and ask them to take a fresh clone afterwards, so that they don't push back any commits with this file.
As mentioned on the BFG page, please backup the mirror clone before making any changes. I also recommend pushing your changes to a newly created empty repo first so you can check if the repo looks good before pushing to the repo you normally use.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.