从“ .git / info / exclude”文件中包含的合并中排除文件的最佳方法是什么?

问题描述 投票:1回答:2

我在“ .git / info / exclude”文件中指定了一些文件,以便在我进行提交时,这些文件不会暂存/不包含在提交中。我合并时想保留这些文件的本地版本。我已经设置了一个“我们的”合并驱动程序,并适当地设置了“ .git / info / attributes”文件(我认为);但是,我不认为正在使用驱动程序,因为我认为尝试合并时git无法检测到这些文件中的任何冲突。

这是我的“ .git / info / exclude”文件(这给了我我想要的-这些文件永远都不会上演):

/IDWA.Client/dmsConfig.json
/IDWA.Server.AppServer/client-config*.*
/IDWA.Server.AppServer/dmsConfig.json

这是我的“ .git / info / attributes”文件(似乎根本没有做任何事情;再次,我认为是因为git在尝试合并时未检测到任何冲突):

/IDWA.Client/dmsConfig.json merge=ours
/IDWA.Server.AppServer/client-config*.* merge=ours
/IDWA.Server.AppServer/dmsConfig.json merge=ours

驱动程序配置:

git config --global merge.ours.driver true

最后,..

enter image description here

我只希望能够进行git pull,而不必担心这些文件。

git git-merge git-pull gitattributes
2个回答
0
投票
这是我的“ .git / info / attributes”文件(似乎根本没有做任何事情;
仅在合并

冲突时有效。

由于已经跟踪了这些文件,请尝试:

git update-index --skip-worktree -- a file

请参见“ Git - Difference Between 'assume-unchanged' and 'skip-worktree'”。

© www.soinside.com 2019 - 2024. All rights reserved.