0

ブランチを切り替えるたびにエラーが発生します。

私はこれを数回行いました:

https://help.github.com/articles/dealing-with-line-endings

    git rm --cached -r .
# Remove everything from the index.


git reset --hard
# Write both the index and working directory from git's database.


git add .
# Prepare to make a commit by staging all the files that will get normalized.

# This is your chance to inspect which files were never normalized. You should 
# get lots of messages like: "warning: CRLF will be replaced by LF in file."

git commit -m "Normalize line endings"
# Commit

そして、問題はまだ発生します。

私の .gitattribute ファイルは次のようになります。

# 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

エラーが発生します:

「エラー: 次のファイルに対するローカルの変更は、チェックアウトによって上書きされます:」

4

1 に答える 1

2

エラー: 次のファイルに対するローカルの変更は、チェックアウトによって上書きされます:

これは、一部のファイルがリポジトリにコミットされていないために発生します。git add .現在のディレクトリに追跡されたファイルのみを追加します。これを修正するには、次のことができます。

  • 各ファイルを手動で追加し ( git add <file>)、ファイルへのフル パスを指定します。
  • を使用しgit add -Aます。

のマンページはこちらですgit-add

于 2013-04-05T10:27:27.977 に答える