在 git 中跟踪 sqlite3 二进制文件的正确方法?
我维护一个仓库的分支。
该存储库一直在跟踪二进制文件(这是一个 sqlite3 文件)。
每次我从该存储库中提取数据时,都会因该二进制文件而遇到合并冲突。
解决这种合并冲突的正确方法是什么?
在 git 中管理二进制文件(如 sqlite3 *.db 文件)的正确方法是什么?
I maintain a fork of a repo.
That repo which has been tracking a binary file (which is a sqlite3 file).
Every time I pull from that repo, I experience merge conflict due to that binary file.
What is the right way to solve this kind of merge conflict?
What is the right way to manage binary files (like this sqlite3 *.db file) in git?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以定义一个自定义合并驱动程序,指定 始终“keep他们的”(复制您正在拉取的版本)位于当前版本之上。
(话虽这么说,请记住 二进制文件是使用 Git 并不总是最好的管理,特别是如果它们经常修改的话)
You could define a custom merge driver specifying to always "keep theirs" (copy the version you are pulling) on top of your current version.
(That being said, remember binaries aren't always best managed with Git, especially if they are modified often)
我已经发布了一个可以满足您要求的工具。它使用自定义 diff 驱动程序,利用 sqlite 项目工具“sqldiff”,将 UUID 作为主键,并省略 sqlite rowid。它仍处于 alpha 阶段,因此欢迎反馈。
https://github.com/cannadayr/git-sqlite
I've released a tool that does what you're asking for. It uses a custom diff driver leveraging the sqlite projects tool 'sqldiff', UUIDs as primary keys, and leaves off the sqlite rowid. It is still in alpha so feedback is appreciated.
https://github.com/cannadayr/git-sqlite