How do I run a code formatter over my source without modifying git history?

后端 未结 5 1747
日久生厌
日久生厌 2020-11-30 10:35

I am trying to format an entire repo using a code formatter tool. In doing so, I want to keep information about who committed which line, so that commands like git bla

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 11:08

    git blame -w -M is supposed to ignore whitespace and moved code changes, so you just need to reformat your code and remember to use those options when looking for who to blame!

    https://coderwall.com/p/x8xbnq/git-don-t-blame-people-for-changing-whitespaces-or-moving-code

提交回复
热议问题