1

I just added some changes to my git repository. All is good except it shows changes to .gitmodules, and shows changes not staged for commit in two module directories. As far as I know, I did not make any changes to .gitmodules or these two directories. How do I determine which files were modified in these directories, and what was changed?

[Michael@devserver maindir]$ git add .
[Michael@devserver maindir]$ git status
On branch master
Your branch is ahead of 'origin/master' by 5 commits.
  (use "git push" to publish your local commits)
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   .gitmodules
        A BUNCH OF OTHER FILES WHICH I CHANGED

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)
  (commit or discard the untracked or modified content in submodules)

        modified:   application/classes_3rd/PHPMailer (modified content)
        modified:   application/classes_3rd/parsecsv (modified content)

[Michael@devserver maindir]$ cat .gitmodules
[submodule "application/classes_3rd/PHPMailer"]
        path = application/classes_3rd/PHPMailer
        url = https://github.com/Synchro/PHPMailer.git
[submodule "application/classes_3rd/parsecsv"]
        path = application/classes_3rd/parsecsv
        url = https://github.com/parsecsv/parsecsv-for-php.git
[Michael@devserver maindir]$

EDIT. Per VonC's answer...

[Michael@devserver maindir]$ cd application/classes_3rd/PHPMailer
[Michael@devserver PHPMailer]$ git status
HEAD detached at 245381c
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:   .gitignore
        modified:   .scrutinizer.yml
        modified:   .travis.yml
        modified:   LICENSE
        modified:   PHPMailerAutoload.php
        modified:   README.md
        modified:   changelog.md
        modified:   class.phpmailer.php
        modified:   class.pop3.php
        modified:   class.smtp.php
        modified:   composer.json
        modified:   docs/Callback_function_notes.txt
        modified:   docs/DomainKeys_notes.txt
        modified:   docs/Note_for_SMTP_debugging.txt
        modified:   docs/extending.html
        modified:   docs/faq.html
        modified:   docs/pop3_article.txt
        modified:   examples/LGPLv3.txt
        modified:   examples/code_generator.phps
        modified:   examples/contents.html
        modified:   examples/exceptions.phps
        modified:   examples/gmail.phps
        modified:   examples/images/phpmailer.png
        modified:   examples/images/phpmailer_mini.png
        modified:   examples/index.html
        modified:   examples/mail.phps
        modified:   examples/mailing_list.phps
        modified:   examples/pop_before_smtp.phps
        modified:   examples/scripts/shAutoloader.js
        modified:   examples/scripts/shBrushPhp.js
        modified:   examples/scripts/shCore.js
        modified:   examples/scripts/shLegacy.js
        modified:   examples/sendmail.phps
        modified:   examples/smtp.phps
        modified:   examples/smtp_no_auth.phps
        modified:   examples/styles/shCore.css
        modified:   examples/styles/shCoreDefault.css
        modified:   examples/styles/shCoreDjango.css
        modified:   examples/styles/shCoreEclipse.css
        modified:   examples/styles/shCoreEmacs.css
        modified:   examples/styles/shCoreFadeToGrey.css
        modified:   examples/styles/shCoreMDUltra.css
        modified:   examples/styles/shCoreMidnight.css
        modified:   examples/styles/shCoreRDark.css
        modified:   examples/styles/shThemeAppleScript.css
        modified:   examples/styles/shThemeDefault.css
        modified:   examples/styles/shThemeDjango.css
        modified:   examples/styles/shThemeEclipse.css
        modified:   examples/styles/shThemeEmacs.css
        modified:   examples/styles/shThemeFadeToGrey.css
        modified:   examples/styles/shThemeMDUltra.css
        modified:   examples/styles/shThemeMidnight.css
        modified:   examples/styles/shThemeRDark.css
        modified:   examples/styles/shThemeVisualStudio.css
        modified:   examples/styles/wrapping.png
        modified:   extras/EasyPeasyICS.php
        modified:   extras/class.html2text.php
        modified:   extras/htmlfilter.php
        modified:   extras/ntlm_sasl_client.php
        modified:   language/phpmailer.lang-ar.php
        modified:   language/phpmailer.lang-be.php
        modified:   language/phpmailer.lang-br.php
        modified:   language/phpmailer.lang-ca.php
        modified:   language/phpmailer.lang-ch.php
        modified:   language/phpmailer.lang-cz.php
        modified:   language/phpmailer.lang-de.php
        modified:   language/phpmailer.lang-dk.php
        modified:   language/phpmailer.lang-el.php
        modified:   language/phpmailer.lang-eo.php
        modified:   language/phpmailer.lang-es.php
        modified:   language/phpmailer.lang-et.php
        modified:   language/phpmailer.lang-fa.php
        modified:   language/phpmailer.lang-fi.php
        modified:   language/phpmailer.lang-fo.php
        modified:   language/phpmailer.lang-fr.php
        modified:   language/phpmailer.lang-gl.php
        modified:   language/phpmailer.lang-he.php
        modified:   language/phpmailer.lang-hr.php
        modified:   language/phpmailer.lang-hu.php
        modified:   language/phpmailer.lang-it.php
        modified:   language/phpmailer.lang-ja.php
        modified:   language/phpmailer.lang-ka.php
        modified:   language/phpmailer.lang-lt.php
        modified:   language/phpmailer.lang-lv.php
        modified:   language/phpmailer.lang-nl.php
        modified:   language/phpmailer.lang-no.php
        modified:   language/phpmailer.lang-pl.php
        modified:   language/phpmailer.lang-pt.php
        modified:   language/phpmailer.lang-ro.php
        modified:   language/phpmailer.lang-ru.php
        modified:   language/phpmailer.lang-se.php
        modified:   language/phpmailer.lang-sk.php
        modified:   language/phpmailer.lang-sr.php
        modified:   language/phpmailer.lang-tr.php
        modified:   language/phpmailer.lang-uk.php
        modified:   language/phpmailer.lang-vi.php
        modified:   language/phpmailer.lang-zh.php
        modified:   language/phpmailer.lang-zh_cn.php
        modified:   test/bootstrap.php
        modified:   test/phpmailerLangTest.php
        modified:   test/phpmailerTest.php
        modified:   test/test_callback.php
        modified:   test/testbootstrap-dist.php
        modified:   travis.phpunit.xml.dist

no changes added to commit (use "git add" and/or "git commit -a")
[Michael@devserver PHPMailer]$ git diff README.md
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
[Michael@devserver PHPMailer]$ git diff --cached README.md
[Michael@devserver PHPMailer]$ git diff HEAD README.md
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
[Michael@devserver PHPMailer]$ cd ../parsecsv
[Michael@devserver parsecsv]$ git status
HEAD detached at 7e7aeba
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:   ChangeLog.txt
        modified:   License.txt
        modified:   README.md
        modified:   examples/_books.csv
        modified:   examples/basic.php
        modified:   examples/conditions.php
        modified:   examples/download.php
        modified:   examples/limit.php
        modified:   parsecsv.lib.php

no changes added to commit (use "git add" and/or "git commit -a")
[Michael@devserver parsecsv]$ git diff ChangeLog.txt
diff --git a/ChangeLog.txt b/ChangeLog.txt
old mode 100644
new mode 100755
[Michael@devserver parsecsv]$ git diff --cached ChangeLog.txt
[Michael@devserver parsecsv]$ git diff HEAD ChangeLog.txt
diff --git a/ChangeLog.txt b/ChangeLog.txt
old mode 100644
new mode 100755
[Michael@devserver parsecsv]$
user1032531
  • 24,767
  • 68
  • 217
  • 387

1 Answers1

1

How do I determine which files were modified in these directories, and what was changed?

You can simply go within one of those submodule folders and do a status:

cd application/classes_3rd/PHPMailer
git status
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you VonC. Doing as you indicated definitely showed a bunch of file changes. What is changes still escapes me. I don't think I made any changes. Why would they be shown as changes. See my original post. `git diff` shows an old mode and new mode? – user1032531 Jan 01 '15 at 18:01
  • Using `git diff --cached ChangeLog.txt` shows no change. Is this wrong? I will try as you suggested and visually compare them. – user1032531 Jan 01 '15 at 18:15
  • @user1032531 http://stackoverflow.com/a/22392960/6309 check if `git config core.filemode false` improves the situation. You might have to clone everything again to see if that works better. – VonC Jan 01 '15 at 18:16
  • Using the recommended solutions in your referenced other posts didn't change anything, however, you are absolutely correct in that the file mode was changed. Thank you and have Happy New Year! – user1032531 Jan 01 '15 at 18:28
  • @user1032531 And an Happy New Year to you too. – VonC Jan 01 '15 at 19:51