私はgitに奇妙な問題があります。私の .gitignore ファイルは追跡されているようですが、コミットできません。
コマンドライン:
user@STATION ~/repository (my_first_branch)
$ git checkout my_second_branch
error: Your local changes to the following files would be overwritten by checkout:
.gitignore
Please, commit your changes or stash them before you can switch branches.
Aborting
user@STATION ~/repository (my_first_branch)
$ git add .gitignore
user@STATION ~/repository (my_first_branch)
$ git commit
# On branch my_first_branch
nothing to commit, working directory clean
user@STATION ~/repository (my_first_branch)
$
そのため、.gitignore のために他のブランチをチェックアウトできず、それについては何もできません。
私が見つけた唯一の解決策は、.gitignore を手動で削除することですが、追跡したいと思います。ファイル .gitignore が .gitignored になく、追跡されない理由がわかりません。
コミットしたり隠したりすることはできません。
更新: git ステータス:
user@STATION ~/repository (my_first_branch)
$ git status
# On branch my_first_branch
nothing to commit, working directory clean