I've used a perl script to modify all tab characters in a php git repository and changed them all to 4 spaces.
$ find -iname \*.php -exec perl -pi -e "s/\t/ /g" {} \
I can commit this change with git commit
, but it will mark me as the author of all changed lines inside git blame
after this commit is made.
Is there any way to commit this massive change that doesn't mark me as the author of the changed lines, but retains the original author? That's a lot of history we don't really want to lose in our project.
Our purpose in replacing tabs with 4 spaces is not to make things appear different in git blame, but to follow proper PEAR coding standards. E.g. no tabs, use 4 spaces for indentation.
The git blame command is used to know who/which commit is responsible for the latest changes made to a file. The author/commit of each line can also been seen.
Summary. The git blame command is used to examine the contents of a file line by line and see when each line was last modified and who the author of the modifications was. The output format of git blame can be altered with various command line options.
git-blame-ignore-revs . It expects one commit hash per line, and all commits in the file will be ignored by git blame . You can add comments to this file by prefixing it with a # , and I'd recommend commenting each sha to explain why it's being skipped. $ cat .git-blame-ignore-revs. # Upgrade to Prettier 2.0.
The Raw, Blame, and History buttons appear when viewing a single file of a repository. For example, let's visit the README.md file by clicking on it: The Raw button, like the name suggests, opens the file in a raw form, meaning that any HTML formatting disappears.
It isn't the responsibility of the commit command to decide how to treat whitespaces, but the responsibility of the blame command because it is blame which analyzes the differences between versions to get the author of each line. So searching for an option to ignore whitespace in blame:
The option -w is defined as: "Ignore whitespace when comparing the parent's version and the child's to find where the lines came from." http://kernel.org/pub/software/scm/git/docs/git-blame.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With