git - 不要忽略 git sourcetree 中的文件

标签 git version-control gitignore atlassian-sourcetree

我正在从源代码树下载一个 eclipse 项目。 .project 和 .classpath 文件未 checkin 。我希望 checkin 这些文件以成功导入。我没有 gitignore 文件。任何人都可以阐明为什么这些文件没有出现吗?

我还查看了检查这些文件的源机器,文件就在那里。在那台机器上的 sourcetree 版本中,它不再显示要 checkin 的文件。

My exlude file looks like this:
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
.DS_Store

好像也不是这样。

谢谢!

最佳答案

正如@adam-dymitruk 告诉您的那样,您的文件尚未提交到存储库,或者您忽略了它们。运行此命令:

$ git config --get core.excludesfile

然后查看您获得的文件。你可能有一些排除你的 IDE 文件的模式。我知道 PHPStorm 在某些时候会要求您在全局范围内排除他们的文件。可能有人(或 eclipse)在您的源机器上做了同样的事情。

关于git - 不要忽略 git sourcetree 中的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13826246/

相关文章:

git svn rebase 总是需要强制推送

git - "git svn"命令失败,出现错误 "git: ' svn ' is not a git command. See ' git --help '."

GITLAB:如何将整个分支推送到另一个分支

version-control - 在 GitLab 中安全地存储 secret 和凭据

svn - Tortoise SVN 搭建服务器和客户端环境

git - 另一个项目中完全独立的 Git 项目仅使用 gitignore

git - 使用 Git 并推送到生产模式(带图表)

linux - 在 Windows 和 Linux 中使用相同(区域设置)git repo 的最佳方法

Git - 在 .gitignore 中提交文件

gitignore - 使用 Tower 忽略 gitignore 文件中的 .DS_Store