I accidently tried to write file to my repo that has an illegal WIN10 filename

pculverhouse
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 21, 2024

 

"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

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 24, 2024

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events