在做Git平分时如何忽略一个目录? [英] How can I ignore a directory when doing a Git bisect?

查看:100
本文介绍了在做Git平分时如何忽略一个目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个生成构建目录,在合并分支时经常发生冲突。这是一个单独的问题。我需要在使用Git bisect的提交历史记录中发现问题,但出现以下错误:
$ b

I have a production build directory which often conflicts when merging branches. That's a separate issue. I need to find a problem in the commit history using Git bisect, but I get the following error:


平分:合并基数必须为已测试

Bisecting: a merge base must be tested

错误:未经破解的工作树文件'problem_directory / filename.ext'将被合并覆盖。

error: Untracked working tree file 'problem_directory/filename.ext' would be overwritten by merge.

在平分过程中,我可以忽略 problem_directory 吗?

Can I ignore problem_directory during the bisect process?

推荐答案

建立目录不应该因为你遇到的原因而被检入。

Build directories should not be checked in for exactly the reason you're encountering.

考虑将它添加到 .gitignore 并使用一个工具如 BFG Repo Cleaner 将其从历史记录中删除。然后它不会成为你的对分的问题。

Consider adding it to .gitignore and using a tool like BFG Repo Cleaner to remove it from history. Then it will not be a problem for your bisects.

或者,在测试完成后清理构建目录。如果您使用的是 git bisect run ,请将 make clean 或您的编译系统中的等价物放在脚本。

Alternatively, clean up the build directory when your testing is done. If you're using git bisect run, put make clean or the equivalent in your build system at the end of the script.

这篇关于在做Git平分时如何忽略一个目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆