13

私たちはMacを持っている数人のプロジェクトに取り組んでおり、私はWindowsで実行しています。改行に関していくつかの問題が発生します。

私はこれを追加できることをGitHubで読みました:

# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto

# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary

.gitattributesに

しかし、そのファイルをGitHubにコミットして、Macを使用している他の人が同じ設定を取得できるようにする必要がありますか?

重要な場合は、Webサイトをコーディングしています。(PHP、JavaScriptファイルなど)。

ちなみに、Windowsを使用しているのは私だけです...そうですね、何ができますか?

4

2 に答える 2

13

First of all, I recommend reading the documentation first.

It suggests either checking in the .gitattributes file at the root of your repository or inside your local .git folder here: .git/info/attributes.

The latter option will probably have the least impact (if you are the only Windows user).

With this kind of thing I tend to put the onus on whoever 'likes to be different' in the team - e.g. if all but one of the devs are using Mac's and the other is using Windows for example, it should really be up to the guy who is going against the grain to sort out. It's nothing malicious, just fair :-)

于 2013-02-26T13:30:21.253 に答える
8

私はこれを追加しました:

# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto

# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary

GitHub サーバーにコミットしました。だから、これを持っていた人は皆、問題を解決しました。

于 2013-02-27T09:39:34.030 に答える