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 6854739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:40:16+00:00 2026-05-27T01:40:16+00:00

I have a sample HTML file sitting in git. Recently it needs to be

  • 0

I have a sample HTML file sitting in git. Recently it needs to be changed completely, so there isn’t much point looking at the diff between the new and the old.

Currently the diff will display like ++-+–+–+—++, and I want it to just display ——–+++++++.

Is there a way to tell git that this file change is a complete change and users does not need to know line differences, but change as a whole?

P.S. the answer showed the way in diff command, but but it would be great if I can specify permanently this for specific file in commit command.

  • 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-27T01:40:17+00:00Added an answer on May 27, 2026 at 1:40 am

    Every commit in git stores a completely new blob for the file, even if the change was a single character change in a text file ( later on it might be packed with just delta etc. )

    And you should generally not be worried about how and what git stores ( and disk space is cheap)

    Update:

    If you are just worried about the diff that you see when a file is rewritten, you can use the -B option with diff:

    -B[<n>][/<m>]
    –break-rewrites[=[<n>][/<m>]]

    Break complete rewrite changes into pairs of delete and create. This
    serves two purposes:

    It affects the way a change that amounts to a total rewrite of a file
    not as a series of deletion and insertion mixed together with a very
    few lines that happen to match textually as the context, but as a
    single deletion of everything old followed by a single insertion of
    everything new, and the number m controls this aspect of the -B option
    (defaults to 60%). -B/70% specifies that less than 30% of the original
    should remain in the result for git to consider it a total rewrite
    (i.e. otherwise the resulting patch will be a series of deletion and
    insertion mixed together with context lines).

    When used with -M, a totally-rewritten file is also considered as the
    source of a rename (usually -M only considers a file that disappeared
    as the source of a rename), and the number n controls this aspect of
    the -B option (defaults to 50%). -B20% specifies that a change with
    addition and deletion compared to 20% or more of the file’s size are
    eligible for being picked up as a possible source of a rename to
    another file.

    There are more complex methods like using filter-branch etc to remove ( and modify) history, but I won’t recommend those in this case.

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

Sidebar

Related Questions

well i have used an html file like these in iframe <iframe src=sample.html></iframe> is
I have a HTML file in my site with a sample code: <!DOCTYPE html
can anyone help? I have a simple html file which i am filling via
<p title=The test paragraph>This is a sample of some <b>HTML you might<br>have</b> in your
I have a reference of the dll file here: http://speex.org/docs/api/speex-api-reference/group__Codec.html What I'm wondering is,
Demo.php file <?php function write_back() { echo file_get_contents(sample.html); sleep(2); write_back(); } write_back(); ?> Resulted
Is there a way I can echo the whole content of a .html file
I have the following sample HTML code: http://pastebin.com/Mya6tPc6 And here is the jQuery code
I have simple HTML code with some JavaScript. It looks like: <html> <head> <script
I have a simple HTML. I am using the JQuery for AJAX purpose. Now,

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.