验证git模块中的更改

时间:2015-01-01 17:28:27

标签: git

我刚刚在我的git存储库中添加了一些更改。一切都很好,除了它显示.gitmodules的更改,并显示两个模块目录中的提交未进行更改。据我所知,我没有对.gitmodules或这两个目录进行任何更改。如何确定在这些目录中修改了哪些文件以及更改了哪些文件?

[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的回答......

[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]$

1 个答案:

答案 0 :(得分:1)

  

如何确定在这些目录中修改了哪些文件以及更改了哪些文件?

您可以直接进入其中一个子模块文件夹并执行以下状态:

cd application/classes_3rd/PHPMailer
git status