相关疑难解决方法(0)

如何摆脱Git子模块未跟踪状态?

我似乎无法摆脱Git子模块中未跟踪的内容.运行git status收益率:

# On branch master
# Changes not staged for commit:
#   (use "git add ..." to update what will be committed)
#   (use "git checkout -- ..." to discard changes in working directory)
#   (commit or discard the untracked or modified content in submodules)
#
#    modified:   bundle/snipmate (untracked content)
#    modified:   bundle/surround (untracked content)
#    modified:   bundle/trailing-whitespace (untracked content)
#    modified:   bundle/zencoding (untracked content)
#
no changes added to commit (use "git add" and/or "git …

git git-submodules

140
推荐指数
5
解决办法
7万
查看次数

Git:我可以在status,diff等中禁止列出'modified content'/ dirty submodule条目吗?

有些人(我认为在1.6.x版本附近)git意识到了子模块内部的变化.那只会让我烦恼:

$ git status vendor | grep modified:
#       modified:   vendor/rails (modified content)
$ git diff vendor/
diff --git a/vendor/rails b/vendor/rails
--- a/vendor/rails
+++ b/vendor/rails
@@ -1 +1 @@
-Subproject commit 046c900df27994d454b7f906caa0e4226bb42b6f
+Subproject commit 046c900df27994d454b7f906caa0e4226bb42b6f-dirty

请停止?

编辑:

好的,我有答案.现在我有另一个问题:

我可以把它放进去~/.gitconfig吗?从我最初看起来我不能,并且我没有看到任何有希望通过略读补丁.(我想我仍然可以做别名.)

git git-config git-submodules

119
推荐指数
6
解决办法
4万
查看次数

忽略git子模块的新提交

背景

在Linux上使用Git 1.8.1.1.存储库如下所示:

master
  book
Run Code Online (Sandbox Code Playgroud)

子模块创建如下:

$ cd /path/to/master
$ git submodule add https://user@bitbucket.org/user/repo.git book
Run Code Online (Sandbox Code Playgroud)

book子模块是干净的:

$ cd /path/to/master/book/
$ git status
# On branch master
nothing to commit, working directory clean
Run Code Online (Sandbox Code Playgroud)

问题

另一方面,主人显示书子模块有"新提交":

$ cd /path/to/master/
$ git status
# On branch master
# 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:   book (new …
Run Code Online (Sandbox Code Playgroud)

git ignore status git-submodules

73
推荐指数
4
解决办法
4万
查看次数

具有修改和未跟踪内容的git子模块 - 为什么以及如何删除它?

这就是我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:   vim/bundle/pathogen (modified content)
#   modified:   vim/bundle/sparkup (untracked content)
#
no changes added to commit (use "git add" and/or "git commit -a")
Run Code Online (Sandbox Code Playgroud)

跑步git diff vim显示这个:

diff --git a/vim/bundle/pathogen b/vim/bundle/pathogen …
Run Code Online (Sandbox Code Playgroud)

git

51
推荐指数
5
解决办法
5万
查看次数

通过病原体将标签生成到不同的位置

我使用病原体来组织我的vim插件.我git将插件从github克隆到vimbundles目录中.这样,更新它们很简单.

我对病原体产生的标签有问题.如果插件没有在其代码中包含标签,则病原体通过调用生成它们pathogen#helptags().标签生成到doc插件的文件夹中.然后这些文件在git存储库中显示为未跟踪.

你知道如何在不同的位置生成标签吗?所有标签都可以在同一个地方,目标不是将它们生成到插件所在的目录.病原体可以说服吗?

tags vim plugins

15
推荐指数
3
解决办法
2149
查看次数

使用git子模块比在另一个带有gitignore的repo中使用repo有什么好处?

我们一直在研究git子模块,我们想知道使用子模块的存储库有什么优势(如果有的话),在另一个存储库中有一个带有.gitignore文件的存储库.

没有子模块的示例:

mkdir a
cd a
git init
touch test1.txt
echo "b" > .gitignore
git add .
git commit -m "Adding test1.txt and gitignore"

mkdir b
cd b
git init
touch test2.txt
git add .
git commit -m "Adding test2.txt"

git log
cd ..
git log
Run Code Online (Sandbox Code Playgroud)

git github git-submodules

9
推荐指数
1
解决办法
3357
查看次数

Git ignore不会忽略指定的文件夹/文件

我希望我的.gitignore忽略某些文件夹和文件,所以我想出了以下内容:

*.class

# usual java ignores
bin/
.metadata

# Maven
*/target/*
target/*
/target/
*/deploy/*
deploy/*

# src-gen folder is populated by the command of protobuf, these files should not be pushed
src-gen/*

# eclipse generated stuff
dependency-reduced-pom.xml

# we shouldn't have .jar files in our repository, 
# apart from these 5 jars which are vital for our build process
*.jar
!/projectName/bundle/**/*.jar

# For Unix editors 
# sometimes make file copies ending
# with ~
# To ignore them use:
*~ …
Run Code Online (Sandbox Code Playgroud)

git gitignore

6
推荐指数
2
解决办法
4803
查看次数

标签 统计

git ×6

git-submodules ×4

git-config ×1

github ×1

gitignore ×1

ignore ×1

plugins ×1

status ×1

tags ×1

vim ×1