相关疑难解决方法(0)

Windows中的Git符号链接

我们的开发人员使用基于Windows和Unix的操作系统.因此,在Unix机器上创建的符号链接成为Windows开发人员的问题.在windows(msysgit)中,符号链接将转换为文本文件,其中包含指向其所指向文件的路径.相反,我想将符号链接转换为实际的Windows符号链接.

我需要的(更新的)解决方案是:

  • 编写一个post-checkout脚本,以递归方式查找"symlink"文本文件.
  • 将它们替换为具有与虚拟"symlink"相同名称和扩展名的windows符号链接(使用mklink)
  • 通过在.git/info/exclude中添加条目来忽略这些windows符号链接

我没有实现这个,但我相信这是解决这个问题的可靠方法.

问题:

  1. 你对这种方法有什么不利之处呢?
  2. 这个结账后脚本是否可以实现?即我可以递归地找出git创建的虚拟"符号链接"文件吗?
  3. 有没有人已经在这样的脚本上工作过?

windows git symlink

227
推荐指数
11
解决办法
9万
查看次数

BUG:unpack-trees.c:699:pos 必须指向此目录中的第一个条目

我尝试软重置我的分支以删除我不小心推送到 GitHub 的目录。软重置后,我仍然收到以下错误:

fatal: Unable to create '/Users/mprestemon/vagrant-local/www/national-fuel/public_html/wp-content/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
Run Code Online (Sandbox Code Playgroud)

我发现另一篇 StackOverflow 文章说要使用以下命令删除 .git/index.lock:

rm -f ./.git/index.lock
Run Code Online (Sandbox Code Playgroud)

当我运行该命令并尝试从另一个分支签出或拉取时,我现在得到这个 BUG:

BUG: unpack-trees.c:699: pos must point at the first entry in this directory
Run Code Online (Sandbox Code Playgroud)

我不知道如何清理我的存储库并确保所有 git …

git github git-reset

7
推荐指数
2
解决办法
2454
查看次数

错误:无效路径“filePath:Zone.Identifier”

如果我尝试检查开发分支,我会收到此错误:

$ git checkout development
error: invalid path 'src/assets/svg-icon/exit.svg:Zone.Identifier'
Run Code Online (Sandbox Code Playgroud)

谁能告诉我为什么我会得到这个?我正在使用 Windows-10。

git

6
推荐指数
1
解决办法
1万
查看次数

为什么我在 git pull 或 git clone 之后收到“错误:无效路径 '\'”?

我无法从 GitLab 上的存储库中提取新更改,因为我收到以下错误:

Cloning into 'X'...
remote: Enumerating objects: 450, done.
remote: Counting objects: 100% (331/331), done.
remote: Compressing objects: 100% (215/215), done.
remote: Total 450 (delta 145), reused 280 (delta 108), pack-reused 119 eceiving objects: 100% (450/450), 20.83 MiB | 20.82 MiB/s
Receiving objects: 100% (450/450), 26.61 MiB | 20.89 MiB/s, done.
Resolving deltas: 100% (158/158), done.
error: invalid path '\'
fatal: unable to checkout working tree
Run Code Online (Sandbox Code Playgroud)

根据这个问题,我已经尝试过git config core.protectNTFS false,但没有任何改变。然后我尝试git config --system core.longpaths …

git gitlab

0
推荐指数
1
解决办法
5690
查看次数

标签 统计

git ×4

git-reset ×1

github ×1

gitlab ×1

symlink ×1

windows ×1