【发布时间】:2016-12-19 12:50:48
【问题描述】:
我克隆了一个 git 存储库,之后我在git status 中获得了未跟踪和未暂存(修改/删除)的文件。然后我为 Mac 设置了 fileMode=false,几个文件从 unstaged 中消失了。但我无法理解如何处理其他人。我从 stackoverflow 和其他地方尝试了很多东西,但没有任何帮助。
所以我的问题是为什么我在克隆 repo 后立即得到所有这些未跟踪/未暂存的文件,以及如何修复它。我使用 Mac 进行开发,但我尝试在 Windows 中克隆 repo 以查看它是否相同。更有趣的是:它说删除了一些未暂存的文件。
git config 不同修改后,git config -l 的命令如下:
苹果机:
filter.lfs.clean=git-lfs clean %f
filter.lfs.smudge=git-lfs smudge %f
filter.lfs.required=true
user.email=...hidden...
user.name=...hidden...
core.autocrlf=true
core.precomposeunicode=true
core.filemode=false
core.trustctime=false
alias.gr=log --graph --full-history --all --color --decorate
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
remote.origin.url=https://bitbucket.org/...hidden...
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.demo.remote=origin
branch.demo.merge=refs/heads/demo
获胜:
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=https://bitbucket.org/...hidden...
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.demo.remote=origin
branch.demo.merge=refs/heads/demo
我的git status 看起来像这样:
苹果机:
获胜:
如何解决?
【问题讨论】:
-
所以你用两台电脑连接到一个仓库:Mac 和 Win?你的问题是为什么
git status在你从两台 PC 上以相同的方式克隆时两者都不一样? -
我的问题是为什么我在克隆 repo 后立即得到所有这些未跟踪/未暂存的文件,以及如何修复它。我使用 Mac 进行开发,但我尝试在 Windows 中克隆 repo 以查看它是否相同。更有趣的是:它说删除了一些未暂存的文件。
-
that 有帮助吗?您是否有任何理由不将问题限制在 Win OR Mac 上(我认为如果您解决一个问题,它们或多或少都会显示相同的问题,另一个也可能会解决)?建议:明确你尝试过的方法是尽量使问题尽可能简短。恕我直言,配置文件无济于事,但我可能错了。
-
我看过这篇文章,有 2 个答案有帮助,一个是文件模式,另一个是小写双胞胎。但未跟踪的文件仍然存在。我不将问题限制在 Win 或 Mac 的原因是因为我不明白发生了什么,也许有 Windows 的人会回答这个问题,它也会在 Mac 上帮助我。另外,在这种情况下,我已经看到很多关于文件系统差异的帖子,所以我决定至少尝试其中的 2 个。但我还是不明白这个问题。文件名中有非拉丁 unicode(?) 字符,但是我应该怎么做才能让 git 正确理解呢?
标签: windows git macos git-clone git-untracked