Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6064761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:18:56+00:00 2026-05-23T09:18:56+00:00

I accidentally checked in a utf8 encoded text file from Windows without removing the

  • 0

I accidentally checked in a utf8 encoded text file from Windows without removing the BOM before. Now I tried to remove it in a later version and check-in this change again. It seems as git ignores the change to the BOM bytes. Is there a setting to make git let me check-in the file like it is? (I know there is a similar issue when it comes to line endings – and there is a setting for this one…)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:18:56+00:00Added an answer on May 23, 2026 at 9:18 am

    If you can make this reproducible, by all means report a bug

    Here’s my two cents:

    xxd -r > raw <<< "0000000: 4865 c582 c397 c3b8 0a                   He......."
    cat raw # shows "Heł×ø" in UTF8 terminals
    
    git init .
    iconv -t UTF32BE raw  > test
    git commit -am nobom test
    iconv -t UTF32 raw  > test
    git diff # reports: "Binary files a/test and b/test differ"
    git commit -am bom test
    

    Verify different objects present:

    git rev-list --objects --all
    1d0cf0c1871a8743f947bd4582198db4fc1e72b1
    c52c2a8c211a0031e01eef5d5121d5d0b4aabc40
    4740254f8f52094afc131040afc80bb68265e78c 
    fd3c513224525b3ab94a2512cbbfa918793640eb test
    2d9da153c5febf0425437395227381d3a4784154 
    2e54d36463fee81e89423d7d80ccc5d7003aba21 test
    

    or, slightly more direct

    for h in $(git rev-list --all -- test); do git ls-tree $a; done
    100644 blob 2e54d36463fee81e89423d7d80ccc5d7003aba21    test
    100644 blob 2e54d36463fee81e89423d7d80ccc5d7003aba21    test
    

    This is with git 1.7.4.1 on ubuntu 64 bit


    xxd test # no bom:
    0000000: 0000 0048 0000 0065 0000 0142 0000 00d7  ...H...e...B....
    0000010: 0000 00f8 0000 000a                      ........
    
    xxd test # with bom
    0000000: fffe 0000 4800 0000 6500 0000 4201 0000  ....H...e...B...
    0000010: d700 0000 f800 0000 0a00 0000            ............
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems that I accidentally checked in my gen folder from an Android project
I accidentally added a binary file to SVN with the add command, and now
When switching back from a local branch, I accidentally checked out a new branch,
I accidentally pushed a commit to GitHub. Is it possible to remove this commit?
I accidentally reverted all my changes with bzr revert before committing. Are all my
This question may be silly but i accidentally checked in java source code that
Someone (other than myself) accidentally deleted files in TFS and checked it in. He
Unfortunately we accidently checked in a large binary file some time ago and until
I accidentally managed to lose the old version of our data model, and now
I have accidentally checked in some files that I meant keeping locally on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.