近期在git遇到几个问题,让我重新认识到git的强大性,下面列出来记录一下

有一个数据库的配置文件,在用 git add 添加到 index file 时不能透露了相关配置。而如果用 .gitignore 去操作这需求,却会放弃add整个文件,如果这样做的话,commit后其他人就看不到这里面有个config配置文件了,这结果很明显不是我们想要的。怎么做呢?搜索了下要使用git下面的filter配置去过滤那些秘密。官方文档的描述如下:

filter.driver.clean
The command which is used to convert the content of a worktree file to a blob upon checkin. See gitattributes(5) for details.

网友评论