何も考えずMac上のGit diffでExcelの差分を見れるようにする
エクセルをgit管理する際に困るのが、差分が見れない点。
本当はエクセル使いたくないけど、
誰でも使えて必要な機能が揃うエクセル最強説。
代替がなく辛い。
ということで、少しでも事故を減らしたり、
調査を素早くする第一歩として、
自分のMacだけでも差分を見れるようにしようという試みです。
手順
とにかく環境設定の手間を最小限にするため、
何も考えずグローバルに設定します。
一度設定すればリポジトリごとの設定等は不要です。
goをインストール
~$ brew install go
GOPATHの設定
パッケージをインストールするディレクトリを作成して設定
~$ mkdir .go
~/.bash_profile
export GOPATH=$HOME/.go
~$ source .bash_profile
goのパッケージ取得
~$ go get github.com/tokuhirom/git-xlsx-textconv
gitconfigの設定
グローバルのgitconfigに以下を追加
~/.gitconfig
[diff "xlsx"]
binary = true
textconv = $GOPATH/bin/git-xlsx-textconv
gitattributesの設定
.gitattributesを新規作成
~/.gitattributes
*.xlsx diff=xlsx
*.XLSX diff=xlsx
gitconfigに設定を追加
~$ git config --global core.attributesfile ~/.gitattributes
参考
Author And Source
この問題について(何も考えずMac上のGit diffでExcelの差分を見れるようにする), 我々は、より多くの情報をここで見つけました https://qiita.com/mikito/items/11217fbe05830acdee0a著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .