具有修改和未跟踪内容的git子模块 - 为什么以及如何删除它? [英] git submodules with modified and untracked content - why and how to remove it?

查看:1148
本文介绍了具有修改和未跟踪内容的git子模块 - 为什么以及如何删除它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这就是我的 git status 结果如下所示:

 #分支大师
#已更改但未更新:
#(使用git add< file> ...更新将提交的内容)
#(使用git checkout - < file> ...放弃工作目录中的更改)
#(提交或放弃子模块中未跟踪或修改的内容)

#modified:vim / bundle /病毒(修改内容)
#修改:vim / bundle / sparkup(未跟踪内容)

没有更改添加到提交中(使用git add和/或git commit -a )

运行 git diff vim 显示:

  diff --git a / vim / bundle / pathogen b / vim / bundle / pathogen 
--- a / vim / bundle / pathogen
+++ b / vim / bundle / pathogen
@@ -1 +1 @@
- 子项目提交fcf77f5101f3e589ce006c40ad3a0432735a05cf
+子项目提交fcf77f5101f3e589ce006c40ad3a0432735a05cf-dirty
diff --git a / vim / bundle / sparku pb / vim / bundle / sparkup
--- a / vim / bundle / sparkup
+++ b / vim / bundle / sparkup
@@ -1 +1 @@
-Subproject commit 04a81b41f116a19184359a6f8685c192f5c36c70
+子项目提交04a81b41f116a19184359a6f8685c192f5c36c70-dirty

为什么没有跟踪,另一个修改,diff是什么意思?但最重要的是:它是如何发生的以及如何摆脱它?

解决方案 中的一个跟踪文件已经在 vim / bundle / pathogen 不知何故被修改。子模块 vim / bundle / sparkup 中还有一些未跟踪的(并且是无版的)内容。在任何一种情况下,找出修改/未修改的内容的方法是切换到子模块目录并运行 git status 。 (在子模块中未跟踪文件的情况下,这通常是未在上游添加到 .gitignore 的构建产品。)


this is what my git status' result looks like:

# 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:   vim/bundle/pathogen (modified content)
#   modified:   vim/bundle/sparkup (untracked content)
#
no changes added to commit (use "git add" and/or "git commit -a")

running git diff vim shows this:

diff --git a/vim/bundle/pathogen b/vim/bundle/pathogen
--- a/vim/bundle/pathogen
+++ b/vim/bundle/pathogen
@@ -1 +1 @@
-Subproject commit fcf77f5101f3e589ce006c40ad3a0432735a05cf
+Subproject commit fcf77f5101f3e589ce006c40ad3a0432735a05cf-dirty
diff --git a/vim/bundle/sparkup b/vim/bundle/sparkup
--- a/vim/bundle/sparkup
+++ b/vim/bundle/sparkup
@@ -1 +1 @@
-Subproject commit 04a81b41f116a19184359a6f8685c192f5c36c70
+Subproject commit 04a81b41f116a19184359a6f8685c192f5c36c70-dirty

Why is the one untracked, the other modified, what does the diff mean? But most important: how did it happen and how to get rid of it?

解决方案

One of the tracked files in vim/bundle/pathogen has been modified somehow. There is also some untracked (and unignored) content in the submodule vim/bundle/sparkup. In either case, the way to figure out what is modified / untracked is to change into the submodule directory and run git status. (In the case of untracked files in a submodule, this is frequently a build product that has not been added to .gitignore in upstream.)

这篇关于具有修改和未跟踪内容的git子模块 - 为什么以及如何删除它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆