How can I ignore a directory when doing a Git bisect?

坚强是说给别人听的谎言 提交于 2019-12-13 02:17:19

问题


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:


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.



来源:https://stackoverflow.com/questions/37197491/how-can-i-ignore-a-directory-when-doing-a-git-bisect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!