英文:
git clone --sparse on Z/OS USS causes "you have unstaged changes" error
问题
我正在运行在Z/OS Unix系统服务上,尝试从存储库中克隆单个目录,但出现了"未暂存的更改"错误。
原因是README.md文件中有一个 don't
,但我不知道如何解决它。是否有可以使用的git属性设置?
初始命令是用于稀疏克隆。
git clone --sparse https://github.com/myrepo
这会克隆并检出顶级目录和顶级文件。
我进入克隆的目录并运行
git sparse-checkout add JustThisDir
以检出 JustThisDir
。这些命令在我的MacOS笔记本电脑上工作,但在Z/OS USS上出现错误
error: cannot set sparse-checkout patterns: You have unstaged changes.
原来README.md文件显示为已更新,我需要运行
git commit -am "readme fudge"
然后
git sparse-checkout add JustThisDir
才能正常工作。
目录中还有其他顶级文件,但只有 README.md
显示为有未标记的更改。
git diff
显示
-When your application needs messaging, you don’t
+When your application needs messaging, you dont
存储库中有 don't
,但git副本中有 dont
。
英文:
I am running on Z/OS Unix System Services and attempting to git clone a single directory from a repository, but am getting an "unstaged changes" error.
The cause is a don't
in the README.md, but I don't know how to work round it. Is there a git attributes setting that I can use?
The initial command is for a sparse clone.
git clone --sparse https://github.com/myrepo
That clones and checks out the top level directory and top level files.
I cd into the cloned directory and run
git sparse-checkout add JustThisDir
To checkout out JustThisDir
. These commands work on my MacOS laptop, but on Z/OS USS I get an error
error: cannot set sparse-checkout patterns: You have unstaged changes.
Turns out the README.md file is showing as updated, and I need to run
git commit -am "readme fudge"
before the
git sparse-checkout add JustThisDir
works.
There are other top level files in the directory, but it is only the README.md
that shows as having untagged changes.
git diff
shows
-When your application needs messaging, you don’t
+When your application needs messaging, you dont
The repo has don't
, but the git copy has dont
答案1
得分: 0
有人刚刚注意到自述文件中的撇号看起来不对。修复方法是将 don’t
更改为 don't
。
英文:
Someone just spotted that the apostrophe in the readme didn't look right.
The fix was the change don’t
to don't
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论