Tom*_*ash 140 git git-submodules
我似乎无法摆脱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 commit -a")
添加--ignore-submodules
参数会隐藏这些消息; 但我想知道是否有办法以更合适的核心方式摆脱这种污垢.
ezr*_*tre 135
我发现这篇博文整体上都有用.通过向文件ignore = dirty
中的每个条目添加选项.gitmodules
.
[submodule "zen-coding-gedit3"]
path = zen-coding-gedit3
url = git://github.com/leafac/zen-coding-gedit3.git
ignore = dirty
Run Code Online (Sandbox Code Playgroud)
Von*_*onC 88
由于git状态报告未跟踪的内容,因此具有干净状态的实际方法是进入每个子模块,并且:
.gitignore
特定于每个模块的未跟踪内容. .git/info/exclude
,就像peci1 在评论中报告一样.或者在子模块规范中添加脏,如ezraspectre的回答(upvoted)中所述.
git config -f .gitmodules submodule.<path>.ignore untracked
Run Code Online (Sandbox Code Playgroud)或者(通常)添加一个全局 .gitignore
文件~/.gitignore-global
.比如MariánČerný在评论中报告的例子.DS_Store
或者我的情况.见手册页:Carthage/Build
.gitginore
用户希望Git在所有情况下忽略的模式(例如,由用户选择的编辑器生成的备份或临时文件)通常会进入
core.excludesFile
用户指定的文件中~/.gitconfig
.它的默认值是$XDG_CONFIG_HOME/git/ignore
.如果$XDG_CONFIG_HOME
未设置或为空,$HOME/.config/git/ignore
则使用.
Ric*_*ins 11
您也可以转到每个子模块目录并充当分离的git.例如:
cd my/project/submodule
git status
Run Code Online (Sandbox Code Playgroud)
.../获取修改文件列表 /
git add . //to add all of them to commit into submodule
git commit -m "message to your submodule repo"
Run Code Online (Sandbox Code Playgroud)
您还可以使用更新远程子模块库
git submodule update
Run Code Online (Sandbox Code Playgroud)
毕竟
小智 8
这对我来说很好:
git update-index --skip-worktree <path>
Run Code Online (Sandbox Code Playgroud)
如果它不适用于pathname
,请尝试文件名。让我知道这是否也适合您。
这可能是由于detached HEAD
您的子模块分支中的。如果是这种情况,请进入您的子模块路径(例如:./bundle/snipmate
),然后运行git checkout master
。
归档时间: |
|
查看次数: |
73473 次 |
最近记录: |