git 对我从 ./autogen.sh 和 ./configure 生成的文件做了什么?
我正在开发的项目使用 autogen.sh
和 configure
来设置编译,并生成诸如 config.h
等文件。现在,生成后,我假设这些文件将未被跟踪,因此 git status 应该列出这些文件。但是,在运行这两个脚本后执行此操作实际上会产生以下输出:
owner@ubuntu:~/project$ git status
# On branch master
nothing to commit (working directory clean)
nothing to commit (working Directory clean)
意味着自上次提交以来没有任何更改。此外,它没有告诉我您的分支领先于“origin/master”X次提交。
,这意味着没有进行新的提交(由git log确认
) )。
如果这些文件没有被取消跟踪并且还没有被提交,那么 git 如何处理这些文件?我应该提到的是,任何地方都没有 .gitignore
文件。
The project I'm working on uses autogen.sh
and configure
to set up compilation, and these generate files such as config.h
and others. Now, when generated, I would assume that these files would be untracked and so git status
should list these files. However, doing so after running these two scripts actually produces this output:
owner@ubuntu:~/project$ git status
# On branch master
nothing to commit (working directory clean)
The nothing to commit (working directory clean)
implies that nothing has changed since the last commit. Furthermore, it does not tell me that Your branch is ahead of 'origin/master' by X commits.
, meaning that no new commits have been made (confirmed by git log
).
If these files aren't untracked and they have not been committed, how is git treating these files? I should mention that there are no .gitignore
files anywhere.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
git 没有任何特殊的魔法来处理这些文件,尽管也许您的项目确实隐藏在其他地方。检查 git status --ignored 来查看它们是否被忽略。
如果是这样,您还应该检查 .git/info/exclude 以及 git 中的任何全局忽略配置,以查看它们是否导致这些文件被忽略。
git doesn't have any special magic for handling those files, though perhaps your project does hidden away somewhere else. Check with
git status --ignored
to see if they are being ignored anyway.If so, you should also check
.git/info/exclude
, and any global ignore configuration you have in git, to see if they are responsible for those files being ignored.