验证git模块中的更改 [英] Verify changes in git modules
问题描述
我只是添加了一些更改到我的git存储库。除了显示对 .gitmodules
的更改外,所有内容都很好,并且显示了未在两个模块目录中提交的更改。据我所知,我没有对 .gitmodules
或这两个目录进行任何更改。
[Michael @ devserver maindir] $ git add如何确定哪些文件在这些目录中被修改,以及发生了什么变化? 。
[Michael @ devserver maindir] $ git status
在分支主机
上你的分支在5次提交之前在'origin / master'前面。
(使用git push发布你的本地提交)
提交的改动:
(使用git reset HEAD< file> ...来取消)
修改:.gitmodules
其他文件我更改了
更改没有为commit提交:
(使用git add< file> ... 更新将提交的内容)
(使用git checkout - < file> ...放弃工作目录中的更改)
(提交或放弃子模块中未跟踪或修改的内容)
修改:application / classes_3rd / PHPMailer(修改内容)
修改:application / classes_3rd / parsecsv(修改内容)
[Michael @ devserver maindir] $ cat .gitmodules
[submoduleapplication / classes_3rd / PHPMailer]
path = application / classes_3rd / PHPMailer
url = https://github.com/Synchro/PHPMailer.git
[submoduleapplication / classes_3rd / parsecsv]
path = application / classes_3rd / parsecsv
url = https://github.com/parsecsv/parsecsv-for-php.git
[Michael @ devserver maindir]
编辑。每个VonC的答案...
pre $ $ $ $ $ $ $应用程序/ classes_3rd / PHPMailer
[Michael @ devserver maindir] devserver PHPMailer] $ git status
HEAD detached at 245381c
更改没有为commit提交:
(使用git add< file> ...更新将提交的内容)
(使用git checkout - < file> ...放弃工作目录中的更改)
修改:.gitignore
修改:.scrutinizer.yml
修改:.travis.yml
修改:LICENSE
修改:PHPMailerAutoload.php
修改:README.md
修改:changelog.md
修改:class.phpmailer。 php
修改:class.pop3.php
修改:class.smtp.php
修改:composer.json
修改:docs / Callback_function_notes.txt
修改:docs /DomainKeys_notes.txt
已修改:docs / Note_for_SMTP_debugging.txt
修改:docs / extensions.html
修改:docs / faq.html
修改:docs / pop3_article.txt
修改:示例/ LGPLv3.txt
修改:examples / code_generator。 phps
修改:examples / contents.html
修改:examples / exceptions.phps
修改:examples / gmail.phps
修改:examples / images / phpmailer.png
修改:examples / images / phpmailer_mini.png
修改:examples / index.html
修改:examples / mail.phps
修改:examples / mailing_list.phps
修改:示例/pop_before_smtp.phps
修改:examples / scripts / shAutoloader.js
修改:examples / scripts / shBrushPhp.js
修改:examples / scripts / shCore.js
修改:示例/scripts/shLegacy.js
修改:examples / sendmail.phps
修改:examples / smtp.phps
修改:examples / smtp_no_auth.phps
修改:examples / styles / shCore.css
修改:examples / styles / shCoreDefault.css
修改:examples / styles / shCoreDjango.css
修改:examples / styles / shCoreEclipse.css
修改:examples / styles / shCoreEmacs.css
修改:examples / styles / shCoreFadeToGrey.css
修改:examples / styles / shCoreMDUltra.css
modified:examples / styles / shCoreMidnight.css
modified:examples / styles / shCoreRDark.css
修改:examples / styles / shThemeAppleScript.css
修改:examples / styles / shThemeDefault.css
修改:examples / styles / shThemeDjango.css
修改:examples / styles / shThemeEclipse.css
修改:examples / styles / shThemeEmacs.css
修改:examples / styles / shThemeFadeToGrey .css
修改:examples / styles / shThemeMDUltra.css
修改:examples / styles / shThemeMidnight.css
修改:examples / styles / shThemeRDark.css
修改:examples / styles / shThemeVisualStudio.css
修改:examples / styles / wrapping.png
修改:extras / EasyPeasyICS.php
修改:extras / class.html2text.php
修改:extras / htmlfilter.php
修改:extras / ntlm_sasl_client.php
修改: language / phpmailer.lang-ar.php
修改:language / phpmailer.lang-be.php
修改:language / phpmailer.lang-br.php
修改:language / phpmailer.lang -ca.php
修改:language / phpmailer.lang-ch.php
修改:language / phpmailer.lang-cz.php
修改:language / phpmailer.lang-de.php
修改:language / phpmailer.lang-dk.php
修改:language / phpmailer.lang-el.php
修改:language / phpmailer.lang-eo.php
修改:language / phpmailer.lang-es.php
修改:language / phpmailer.lang-et.php
修改:language / phpmailer.lang-fa.php
修改:language / phpmailer .lang-fi.php
修改:language / phpmailer.lang-fo.php
修改:language / phpmailer.lang-fr.php
修改:language / phpmailer.lang-gl。 php
修改:language / phpmailer.lang-he.php
修改:language / phpmailer.lang-hr.php
修改:language / phpmailer.lang-hu.php
修改:language / phpmailer.lang-it.php
修改:language / phpmailer.lang-ja.php
修改:language / phpmailer.lang-ka.php
修改:language / phpmailer .lang-lt.php
修改:language / phpmailer.lang-lv.php
修改:language / phpmailer.lang-nl.php
修改:language / phpmailer.lang-no。 php
修改:language / phpmailer.lang-pl.php
修改:language / phpmailer.lang-pt.php
修改:language / phpmailer.lang-ro.php
修改:language / phpmailer.lang-ru.php
修改:language / phpmailer .lang-se.php
修改:language / phpmailer.lang-sk.php
修改:language / phpmailer.lang-sr.php
修改:language / phpmailer.lang-tr。 php
修改:language / phpmailer.lang-uk.php
修改:language / phpmailer.lang-vi.php
修改:language / phpmailer.lang-zh.php
修改:language / phpmailer.lang-zh_cn.php
修改:test / bootstrap.php
修改:test / phpmailerLangTest.php
修改:test / phpmailerTest.php
修改: test / test_callback.php
修改:test / testbootstrap-dist.php
修改:travis.phpunit.xml.dist
没有更改添加到提交中(使用git add和/或git commit -a)
[Michael @ d evserver PHPMailer] $ git diff README.md
diff --git a / README.md b / README.md
旧模式100644
新模式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模式100644
新模式100755
[Michael @ devserver PHPMailer] $ cd ../parsecsv
[Michael @ devserver parsecsv] $ git status
HEAD detached at 7e7aeba
没有为commit提交更改:
(使用git add< file> ...更新将提交的内容)
(使用git checkout - < file> ...丢弃工作目录中的更改)
修改:ChangeLog.txt
修改:License.txt
修改:README.md
修改:示例/ _books.csv
modified:examples / basic.php
修改:examples / conditions.php
修改:examples / download.php
修改:examples / limit.php
修改:parsecsv.lib.php
没有更改添加到提交(使用git add和/或git commit -a)
[Michael @ devserver parsecsv] $ git diff ChangeLog .txt
diff --git a / ChangeLog.txt b / ChangeLog.txt
旧模式100644
新模式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
旧模式100644
new模式100755
[Michael @ devserver parsecsv] $
< blockquote>
如何确定哪些文件在这些目录中被修改,以及发生了什么变化?
您可以简单地进入其中一个子模块文件夹并执行一个状态:
cd application / classes_3rd / PHPMailer
git status
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]$
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
这篇关于验证git模块中的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!