Tag: git plumbing

删除refs / original / heads / master从git回购后过滤分支 – 树 – filter?

我有同样的问题在这里问: 在根目录中的新git存储库包含子目录中存在的存储库 我在这里遵循这个答案: 在根目录中的新git存储库包含子目录中存在的存储库 现在, gitk –all显示了两个历史logging:一个在当前的master ,一个名为original/refs/heads/master 。 我不知道这第二个历史是什么,或者如何从回购中删除它。 我的资料库中不需要两个历史logging。 我如何摆脱它? 重现自我: mkdir -p project-root/path/to/module cd project-root/path/to/module mkdir dir1 dir2 dir3 for dir in * ; do touch $dir/source-file-$dir.py ; done git init git add . git commit -m 'Initial commit' 现在我们有原始的海报的问题。 让我们使用上面链接的答案将git仓库的根移到project-root: git filter-branch –tree-filter 'mkdir -p path/to/module ; git mv dir1 dir2 […]