在Windows上运行git rebase命令时,Symlink .git / logs被删除

问题描述

我正在Windows 10 PC上运行git和repo。 从https://git-scm.com/download/win下载了Git,从https://www.python.org/downloads/release/python-360/下载了python,并从我们的内部存储库中回购了代码。这些工具的详细信息可以在下面找到。

$ git config --list | grep symlink
core.symlinks=true
  • 符号链接已启用
D:\ws\support\r-sync\my-project-path>repo sync .
Fetching project xx/yy/zz
Fetching projects: 100% (1/1)
Fetching projects: 100% (1/1),done.
error: logs is different in D:/ws/support/r-sync/my-project-path\.git vs D:/ws/support/r-sync/.repo/projects/my-project-path.git
Traceback (most recent call last):
  File "C:\git-tools\git-repo\main.py",line 547,in <module>
    _Main(sys.argv[1:])
  File "C:\git-tools\git-repo\main.py",line 522,in _Main
    result = repo._Run(argv) or 0
  File "C:\git-tools\git-repo\main.py",line 184,in _Run
    result = cmd.Execute(copts,cargs)
  File "C:\git-tools\git-repo\subcmds\sync.py",line 840,in Execute
    project.Sync_LocalHalf(syncbuf,force_sync=opt.force_sync)
  File "C:\git-tools\git-repo\project.py",line 1379,in Sync_LocalHalf
    self._InitWorkTree(force_sync=force_sync,submodules=submodules)
  File "C:\git-tools\git-repo\project.py",line 2578,in _InitWorkTree
    raise e
error.GitError: --force-sync not enabled; cannot overwrite a local work tree. If you're comfortable with the possibility of losing the work tree's git metadata,use `repo sync --force-sync my-project-path` to proceed.

在我的其中一个git中下载并重新标记过时的更改并在Windows上的cmd或git-bash shell中使用“ repo sync”更新工作区时,出现以下错误。 如果不删除受影响的git中的.git / logs目录,就无法摆脱该错误。

  • 错误
repo init --no-repo-verify -u ssh://<my-gerrit-server>/<my-manifest-git> -b <my-branch>
repo sync xx/yy/zz
cd <my-project-path>
repo download xx/yy/zz XX/Y
git rebase origin/master
repo sync .
  • 如何复制它
  • 在Windows 10的cmd或git-bash shell中,运行以下命令
Select ID,MT.ColumnA,FT1.ColumnA,FT1.ColumnB,FT2.ColumnA,FT2.ColumnC,FT3.ColumnA,FT3.ColumnD
from MainTable MT
Left Join FeedTable FTI1 on FT1.fk1 = MT.key
Left Join FeedTable FT2 on FT2.fk2 = MT.key
Left Join FeedTable FT3 on FT3.fk3 = MT.key

我的调查表明,问题始于'git rebase origin / master'步骤。一旦运行git rebase命令, 。\ my-project-path.git下的符号链接“ logs”将被删除,并替换为具有相同名称的纯目录。 。\ my-project-path.git \ logs和..repo \ projects \ my-project-path.git \ logs之间断开连接的结果是同步错误 “错误:D:/ws/support/r-sync/my-project-path.git与D:/ws/support/r-sync/.repo/projects/my-project-path.git中的日志不同”

有人遇到过同样的问题吗?您知道为什么删除了符号链接“ logs”吗?最后如何防止这种情况发生?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)