20
12

More than 5 years have passed since last update.

git statusしたときに(modified content)が発生したので対応した時の記録

Posted at

git status→(modified content)が発生しました。

$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#   (commit or discard the untracked or modified content in submodules)
#
#   modified:   html/js/multiple-select (modified content)
#
no changes added to commit (use "git add" and/or "git commit -a")

調べたら同じ状況に遭遇している方が多いようでした。
どうやらgit の submoduleを利用している場合に発生するようです。
特段難しい話ではありませんが、自分で作業してて、あれってなったので記録しておきます。

対応しました。

該当のsubmoduleのディレクトリに移動し、その差分を確認しました。

$ cd html/js/multiple-select
$ git diff
diff --git a/LICENSE b/LICENSE
old mode 100644
new mode 100755
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
diff --git a/jquery.multiple.select.js b/jquery.multiple.select.js
old mode 100644
new mode 100755
diff --git a/multiple-select.css b/multiple-select.css
old mode 100644
new mode 100755
diff --git a/multiple-select.jquery.json b/multiple-select.jquery.json
old mode 100644
new mode 100755

filemodeの差分が発生していることがわかりました。
差分をチェックアウトして、filemodeを元に戻します。

$ git checkout -- .

これで差分がなくなったはず・・・
もとのディレクトリに戻って再確認します。

$ git status
# On branch master
nothing to commit (working directory clean)

差分がなくなりました。

20
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
12