Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the message "rewrite ... (90%)" after a Git commit mean? [duplicate]

Tags:

git

When git does a commit it rewrites binary files with something similar to rewrite foobar.bin (76%). What is that %? Is it percent changed or percent retained from the older file. I know that git uses a binary delta for files, but I just don't know how much of a rewrite the % represents and it doesn't seem to be in the help page for git help commit.

Thanks!

like image 205
dude Avatar asked Jun 25 '09 21:06

dude


People also ask

What does rewrite mean in git commit?

Roughly speaking, if the diff between the old and new version is bigger than the new version itself, it's a "rewrite". This is tuned for git's original use case of changing source files, most often making localised changes: since it is based on a line-by-line diff, things like reindenting a source file can trigger it.

Does git commit overwrite?

If you've already created a fresh commit, you'll want to use git rebase -i to squash your commit on top of the old one. After you've made this change locally, and verified your commit looks the way you want it to, you'll have to git push --force to overwrite history on the Github remote.

What happens when you commit a change without giving any message?

If you commit without using the -m option, git will open your default text editor with a new file, which will include a commented-out list of all the files/changes that are staged in the commit.

Can you amend commit after pushing?

Changing the latest Git commit message If the message to be changed is for the latest commit to the repository, then the following commands are to be executed: git commit --amend -m "New message" git push --force repository-name branch-name.


1 Answers

Its a measure of the similarity index. The similarity index is the percentage of unchanged lines. git thinks your file is text.

like image 104
Martin Redmond Avatar answered Oct 07 '22 20:10

Martin Redmond