Skip to content
This repository was archived by the owner on Jul 17, 2020. It is now read-only.

akagane99/TestCRLF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TestCRLF

・はやりのGitHubを使ってみたよ。

・改行コードで diff が上手く見れずはまってhistoryよごしたよ。

・気兼ねなく試したいので、リポジトリ作ったよ。

詳しくはここ

html, phpコミット1 改行コードずれ有り

html, phpコミット2 改行コードずれなし

html, phpコミット3 改行コードずれなし

html, phpコミット4 改行コードずれ有り

html, php, text コミット5 改行コードずれなし

html, php, text コミット6 改行コードずれなし

コミット履歴 - 改行コードの変換パターンをいろいろ試してみた。

結論

html, phpコミット4 改行コードずれ有り

GitHubはLF, ローカルはCRLFにして、autocrlf = true にして2ファイルをコミットしたが、1ファイル改行変換されず微妙。

html, php, text コミット6 改行コードずれなし

素直に GitHub 及び ローカルの改行コードを同じにして、git config --global core.autocrlf false コマンドを流すのが良さそう。

気になる人は、デフォルトから autocrlf = true 設定がある下記を、テキストエディタで autocrlf = false に書き換える。

・wsysgitの共通設定 - C:\Program Files (x86)\Git\etc\gitconfig  (このファイルは管理者権限でないと書き換えれない)

・GitHub for windowsの設定 - %USERPROFILE%\AppData\Local\GitHub\PortableGit_どーたらこーたら\etc\gitconfig

参考URL

GitHub for Windowsいろいろ - 役に立ちそうもないTips

そのうちGitの改行コード、空白文字の設定のルールを決める · Issue #12 · CreateSomethingWithStarling-HagiBreakout

git config の core.safecrlf って何のためよ? - 必ず隣あり

環境

windows7

GitHub for windows

autocrlf設定

gitconfig, configで設定可能。4か所

・wsysgitの共通設定 - C:\Program Files (x86)\Git\etc\gitconfig

・wsysgitのユーザー毎設定 - %USERPROFILE%.gitconfig

・GitHub for windowsの設定 - %USERPROFILE%\AppData\Local\GitHub\PortableGit_どーたらこーたら\etc\gitconfig

・各リポジトリの設定 - ダウンロードしたリポジトリ.git\config

正確には確認していないけれども、たぶん設定の序列はこんな感じ。

(弱い)wsysgitの共通設定 < GitHub for windowsの設定 < wsysgitのユーザー毎設定 < 各リポジトリの設定 (強い)

メモ

・wsysgitのユーザー毎設定 - %USERPROFILE%.gitconfig

上記コンフィグは、下記コマンドで設定、確認ができた。

--- .gitconfig の autocrlf設定

git config --global core.autocrlf true

--- .gitconfig の autocrlf確認

git config --get core.autocrlf

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published