上周,我按照 in this blog 概述的步骤将两个 git 存储库 merge 为一个新存储库。 。据我所知,这一切都很顺利。所有文件都存在。我能够通过 SHA 找到所有提交。
现在,我正在使用 TortoiseGit 检查单个文件的日志历史记录。我启用了“跟随重命名”。当我查看历史记录时,我没有看到我转换到新存储库的任何分支的任何提交消息,但我确实看到了旧分支的所有提交消息:
当我运行 gitk --follow User.cs
时,我能够按预期看到提交消息:
我尝试解决的步骤:
- 将 Git 更新到最新版本:2.10.2.windows.1
- 重新安装 TortoiseGit。已经是最新版本:2.3.0
- 删除存储库并再次 pull 它。
- 进入 TortoiseGit -> 设置 -> 保存的数据并清除所有数据。
- 在 TortoiseGit Gitlab 问题跟踪器上查找错误报告。我什么也没找到。
我的两台机器上都出现此问题。 merge 两个存储库时使用了两台机器。我的同事都没有遇到过这个问题。他们没有使用 PC 来协助 merge 存储库。
问题:有人知道我应该考虑修复我的 TortoiseGit 实例的任何其他缓存、设置或其他配置选项吗?
作为引用,博客中概述的步骤是:
# Assume the current directory is where we want the new repository to be created
# Create the new repository
git init
# Before we do a merge, we have to have an initial commit, so we’ll make a dummy commit
dir > deleteme.txt
git add .
git commit -m “Initial dummy commit”
# Add a remote for and fetch the old repo
git remote add -f old_a <OldA repo URL>
# Merge the files from old_a/master into new/master
git merge old_a/master
# Clean up our dummy file because we don’t need it any more
git rm .\deleteme.txt
git commit -m “Clean up initial file”
# Move the old_a repo files and folders into a subdirectory so they don’t collide with the other repo coming later
mkdir old_a
dir –exclude old_a | %{git mv $_.Name old_a}
# Commit the move
git commit -m “Move old_a files into subdir”
# Do the same thing for old_b
git remote add -f old_b <OldB repo URL>
git merge old_b/master
mkdir old_b
dir –exclude old_a,old_b | %{git mv $_.Name old_b}
git commit -m “Move old_b files into subdir”
##########################
# Bring over a feature branch from one of the old repos
git checkout -b feature-in-progress
git merge -s recursive -Xsubtree=old_a old_a/feature-in-progress
最佳答案
请尝试从您分享的第一张图片中选择刷新按钮(左下)上方的所有分支。您将找到所有分支和提交历史记录。
关于git - TortoiseGit 日志在某些环境中未显示所有预期的提交消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40896903/