gpt4 book ai didi

git - 如何修复git中的 "modified content, untracked content"?

转载 作者:行者123 更新时间:2023-12-02 13:19:44 37 4
gpt4 key购买 nike

目标是提交一个 git 分支。分支的“git status”的输出是:

On branch zeromq_new
Your branch is up to date with 'origin/zeromq'.

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: log4cplus (modified content, untracked content)
modified: ../lib/notification/cppzmq (modified content)

目录结构如下:

HySecureGateway
├──fes
│  └──log4cplus
│  ├──.git
│  ├──.gitattributes
│  ├──.gitignore
│  ├──.gitmodules
│  ├──catch
│  │ ├──.git
│  │ ├──.gitattributes
│  │ ├──.github
│  │ ├──.gitignore
│  │ └──.github
│  │ ├──issue_template.md
│  │ └──pull_request_template.md
│  └──threadpool
│  └──.github
└──lib
└──notification
└──cppzmq
├──.git
└──.gitignore

我在这里阅读了类似问题的答案:

How to track untracked content? ,

并不能完全理解它。logc4plus/.gitmodules 还包含以下内容:

[submodule "threadpool"]

path = threadpool
url = https://github.com/log4cplus/ThreadPool.git

[submodule "catch"]

path = catch
url = https://github.com/philsquared/Catch.git

最佳答案

我所做的是运行:

git rm -rf --cached myuntrackedfolder

这告诉 git 忘记它(因为它被正式跟踪)。

然后我用了:

git add myuntrackedfolder 

添加它,我就可以开始了。

关于git - 如何修复git中的 "modified content, untracked content"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50167969/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com