当我们使用git进行版本控制时,将Core Data模型文件放置其中,我们总是在合并更改方面遇到困难——我们找到的唯一可靠的方法是在一个人进行必要的更改和推送之前,通过团队间的沟通来阻止对模型的访问,然后是下一个人,以此类推。当然,肯定有更好的处理方式,但作为一个git新手,我没有想到明显的解决方案。你有什么建议吗?
git diff other-branch...my-branch -- /path/to/model
查看其他分支中对模型所做的更改。
git diff my-branch...other-branch -- /path/to/model
在您审核更改后,让我们尝试在我们的分支上进行合并:
git merge other-branch
git diff --cached /path/to/model
git checkout --ours -- /path/to/model
git diff -- /path/to/model
一旦你满意了,只需git-add模型文件,以便不再标记为未合并状态,然后提交:
git add /path/to/model
git commit