How can I ignore a directory when doing a Git bise

2019-08-15 10:30发布

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

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

Can I ignore problem_directory during the bisect process?

1条回答
走好不送
2楼-- · 2019-08-15 11:17

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

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.

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.

查看更多
登录 后发表回答