前回のコミット後とまったく同じように、クリーンな作業ディレクトリに戻りたいだけです。Git は、私が行っていない大量のファイル変更を報告しているので、行末に関係があると思われます。
私はこれを行うためにすべての通常の容疑者を試しました:
git reset --hard
git commit -- .
git stash
git clean -fd
何をしても、git status
変更されたものと同じファイルが常に表示されます。私に何ができる?コミットされていない変更が別のブランチに隠されているため、すべてを爆破するのではなく、マスター ブランチを「ロールバック」するだけです。
編集:出力
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: demo/index.html
# modified: demo/js/app.js
# modified: demo/js/libs/jquery.1.7.1.js
# modified: demo/js/libs/matchMedia.js
# modified: demo/js/libs/modernizr.js
# modified: demo/js/loadr.js
# modified: dist/enquire.js
# modified: src/include/intro.js
#
no changes added to commit (use "git add" and/or "git commit -a")
次に、提案されていることと、見つけた他のすべてを試します。
WickyNilliams at Nick MBA in ~/Repositories/enquire on master*
$ git checkout -- .
WickyNilliams at Nick MBA in ~/Repositories/enquire on master*
$ git reset --hard
HEAD is now at d70fee4 added meta tag to test demo on mobile #10
WickyNilliams at Nick MBA in ~/Repositories/enquire on master*
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: demo/index.html
# modified: demo/js/app.js
# modified: demo/js/libs/jquery.1.7.1.js
# modified: demo/js/libs/matchMedia.js
# modified: demo/js/libs/modernizr.js
# modified: demo/js/loadr.js
# modified: dist/enquire.js
# modified: src/include/intro.js
#
no changes added to commit (use "git add" and/or "git commit -a")
ご覧のとおり、ロールバックしても変化はありません。
それで、私はアドバイスに従い、すべてのスペースを無視して差分を実行しました。疑わしいように、スペースを無視しても違いはないようです-だから、それは行末だったと思います! これを修正するにはどうすればよいですか? 無駄に設定しましautocrlf
た。true